Search not working in a link field #4591
-
On one of my entries, I have a Entry field which pulls a list of 1000+ entries to select from. The titles aren't super helpful to search through, so I'd like to be able to search the content field as well (and maybe a couple others?). I've looked at the docs for search, but I can't seem to get it working. Here's what I've tried: I added a new search index for standards: 'indexes' => [
'default' => [
'driver' => 'local',
'searchables' => 'all',
'fields' => ['title'],
],
'standards' => [
'driver' => 'local',
'searchables' => 'collection:standards',
'fields' => ['title', 'content', 'standards_category'],
],
], Then I added a reference to the index in the standards yaml file: title: Standards
search_index: standards
I ran the update search index command:
php please search:update standards After doing this, the field still is not searching anything other than the PS: I also tried editing the original search index, but that didn't do anything either. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Fieldtypes like the Link fieldtype or the Entry fieldtype don't make use of Statamic's search functionality (which is what you're updating the config for). The code for doing search in the fieldtypes are pretty dumb (with it hard coded to search the entry title) - see: https://github.com/statamic/cms/blob/3.2/src/Fieldtypes/Entries.php#L145 Unfortunatley, that means right now I don't think there's a way to get what you're trying to do to work. |
Beta Was this translation helpful? Give feedback.
Fieldtypes like the Link fieldtype or the Entry fieldtype don't make use of Statamic's search functionality (which is what you're updating the config for).
The code for doing search in the fieldtypes are pretty dumb (with it hard coded to search the entry title) - see: https://github.com/statamic/cms/blob/3.2/src/Fieldtypes/Entries.php#L145
Unfortunatley, that means right now I don't think there's a way to get what you're trying to do to work.