earthworks
earthworks copied to clipboard
Smart suggest using search
Implement "smart suggest" using the Solr select endpoint rather than suggest in order to get the document IDs for the title results, so they can be directly linked to.
When the user types in a string a search for the string with *
appended of dct_title_ti
and dct_spatial_tmi
is performed. The results are stored in an instance of the new Suggestions
class which has methods to return locations, datasets and maps. Each of the suggestions is an instance of Suggestion
which can highlight the query.
TODO: the Suggester, Suggestions and Suggestion classes need unit tests. I tested with 4k documents and it seemed to perform similarly to the suggest endpoint, but it will be useful to see how it performs with more.
Closes #1047