docs icon indicating copy to clipboard operation
docs copied to clipboard

How to configure the local search ("Comb")?

Open j3ll3yfi5h opened this issue 3 years ago • 3 comments

https://statamic.com/index.php/forum/3589-how-to-configure-the-local-search-comb

Unfortunately the search is still not documented.

j3ll3yfi5h avatar Sep 23 '21 14:09 j3ll3yfi5h

You can add those to your search.php config file.

https://github.com/statamic/cms/blob/ed98ff5b2ddc8904687b058e6afea6edef8993ba/src/Search/Comb/Index.php#L50-L64

// config/statamic/search.php

'indexes' => [
  'default' => [
    'driver' => 'local',
    'use_stemming' => true,
  ]
],

jasonvarga avatar Sep 23 '21 15:09 jasonvarga

Hm... I tried using: 'min_word_characters' => 4

Doesn't do anything.

But if I change it here: https://github.com/statamic/cms/blob/ed98ff5b2ddc8904687b058e6afea6edef8993ba/src/Search/Comb/Comb.php#L52

It works as expected.

As a second customization I need to disable preformat() on this line: https://github.com/statamic/cms/blob/ed98ff5b2ddc8904687b058e6afea6edef8993ba/src/Search/Comb/Comb.php#L369

Any ideas?

j3ll3yfi5h avatar Sep 23 '21 15:09 j3ll3yfi5h

EDIT: 'min_word_characters' => 4 works, I added it to the wrong search index first.

j3ll3yfi5h avatar Sep 24 '21 06:09 j3ll3yfi5h