You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I use the "select" or "typeahead" UI Mode for an Entry Field, then custom indexes don't seem to be consulted when selecting entries. Note that custom indexes are consulted when using the "stack" UI Mode.
This is probably a limitation of the kind of UI element being used for "select" and "typeahead" presentations, both of which seem to use variations of a dropdown select field. These usually only allow selection by the text shown in the field, which seems to be the "title" field.
It would be great if the custom indexes would work, or if, alternatively, a way were provided to define fields to be used for the text of these select fields so that they could be more flexible than simple titles.
At a minimum, it would help to have a warning on the UI Mode option that lets users know that only titles will be shown for anything other than "stack" presentations.
How to reproduce
For example, in my case I have Courses that are linked from Student Projects.
In /content/collections/courses.yaml I have...
search_index: courses
To keep this simple, in /config/statamic/search.php I am just trying a transform of the title field
And, of course, I have done php please search:update courses to update the index.
But still, when I type one of the identifiers into the a course entry field in a related student projects entry, I get no hits, it just appears to search the titles that are visible in the dropdown.
However, in the list of course entries, I think this search is working, since I can now get hits from text that is not in the course title or slug.
I'd be happy to do something similar to the index transform or to create an alternative calculated field to be used in the select dropdown, but I don't see any way to do that.
By the way, I found a work-around, which is to make title computed and add to it the values I need there. I've created a page_title to hold what used to be in title. I don't know if there are some hidden side effects to computing the title, but it seems to be working for me. I still think some warning in the UI Mode instructions on Entry fields would be helpful.
Bug description
If I use the "select" or "typeahead" UI Mode for an Entry Field, then custom indexes don't seem to be consulted when selecting entries. Note that custom indexes are consulted when using the "stack" UI Mode.
This is probably a limitation of the kind of UI element being used for "select" and "typeahead" presentations, both of which seem to use variations of a dropdown select field. These usually only allow selection by the text shown in the field, which seems to be the "title" field.
It would be great if the custom indexes would work, or if, alternatively, a way were provided to define fields to be used for the text of these select fields so that they could be more flexible than simple titles.
At a minimum, it would help to have a warning on the UI Mode option that lets users know that only titles will be shown for anything other than "stack" presentations.
How to reproduce
For example, in my case I have Courses that are linked from Student Projects.
In
/content/collections/courses.yaml
I have...To keep this simple, in
/config/statamic/search.php
I am just trying a transform of thetitle
fieldAnd, of course, I have done
php please search:update courses
to update the index.But still, when I type one of the identifiers into the a course entry field in a related student projects entry, I get no hits, it just appears to search the titles that are visible in the dropdown.
However, in the list of course entries, I think this search is working, since I can now get hits from text that is not in the course title or slug.
I'd be happy to do something similar to the index transform or to create an alternative calculated field to be used in the select dropdown, but I don't see any way to do that.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: