# Search method. Question?

**URL:** <https://forum.getkirby.com/t/search-method-question/31326>\
**Category:** Questions\
**Tags:** v4\
**Created:** [April 8, 2024, 2:12pm UTC](https://forum.getkirby.com/t/search-method-question/31326 "2024-04-08T14:12:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gillesvauvarin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gillesvauvarin/32/2351_2.png) [@gillesvauvarin](https://forum.getkirby.com/u/gillesvauvarin)\
**Post date:** [April 8, 2024, 2:12pm UTC](https://forum.getkirby.com/t/search-method-question/31326/1 "2024-04-08T14:12:02Z")

</div>

Hi,

I would like a confirmation concerning the search method.

In the documentation, I see this example:

```auto
// search for full words only
$results = $pages->search('my awesome->search', ['words' => true, 'minlength' => 4]);

```

Does this mean that the search method searches on the exact word sequence (“word1 and word2 and word3”) and that each word must be at least 4 characters long?

Or does it works if i had this text: “Lorem ipsum word1. Blab bla word2 bla bla. word3 anyway.”?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 8, 2024, 2:19pm UTC](https://forum.getkirby.com/t/search-method-question/31326/2 "2024-04-08T14:19:04Z")

</div>

`minLength` refers to the length of the complete search string.  
`words` means, that Kirby only searches for full-word matches, not for parts of the each search string.

But keep in mind that Kirby search does treat each words in the search string as separate queries (OR), so you won’t get search results that contains the complete query string only.

So if a page contains `my` and another `awesome`, both will be returned.

---

<div class="post-metadata">

**Author:** ![gillesvauvarin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gillesvauvarin/32/2351_2.png) [@gillesvauvarin](https://forum.getkirby.com/u/gillesvauvarin)\
**Post date:** [April 8, 2024, 2:36pm UTC](https://forum.getkirby.com/t/search-method-question/31326/3 "2024-04-08T14:36:30Z")

</div>

So if I search “awesome” and `['words' => false]` Kirby return a page where there are “some”? 🤔

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 8, 2024, 2:58pm UTC](https://forum.getkirby.com/t/search-method-question/31326/4 "2024-04-08T14:58:49Z")

</div>

> [@gillesvauvarin](#):
>
> `['words' => false]` Kirby return a page where there are “some”?

Yep

---

<div class="post-metadata">

**Author:** ![gillesvauvarin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gillesvauvarin/32/2351_2.png) [@gillesvauvarin](https://forum.getkirby.com/u/gillesvauvarin)\
**Post date:** [April 8, 2024, 3:01pm UTC](https://forum.getkirby.com/t/search-method-question/31326/5 "2024-04-08T15:01:07Z")

</div>

Thanks Sonja, I now understand better how method search works 🙂

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 8, 2024, 3:05pm UTC](https://forum.getkirby.com/t/search-method-question/31326/6 "2024-04-08T15:05:16Z")

</div>

Maybe you are interested in this plugin: [Better Search | Kirby CMS](https://getkirby.com/plugins/bvdputte/bettersearch)
