PHI-base / PHI5_web_display

PHI5_web_display will allow to display PHI-Canto data
1 stars 0 forks source link

Advanced search does not support substring searches #25

Closed jseager7 closed 2 years ago

jseager7 commented 2 years ago

The Advanced Search page only seems to support searching by prefix, rather than allowing searches for substrings (terms that are contained anywhere within the results).

For example, searching for 'fus' in the Disease field returns 'fusarium ear blight' because 'fus' is a prefix of 'fusarium'.

image

However, searching for 'blight' returns nothing – even though 'blight' is contained in 'fusarium ear blight' – because no disease name begins with 'blight'.

image

This seems to affect every field on the Advanced Search page.

Ideally, the Advanced Search page should support matching by substring, but if that is bad for performance, then the search could be simplified to match a prefix of any word in the results: in that case, searching for 'fus', 'ear', or 'blight' would all match 'fusarium ear blight', but queries like 'rium' and 'light' would not.

I'd suggest that queries that match a prefix of the whole string (that match the start of the text) should be ranked higher than prefixes of a later word or substring. For example, in a search for 'blight', terms like 'blight of rice' would be ranked higher than 'fusarium ear blight'. That is, unless there is some more intelligent ranking algorithm that can be used.

Molecular-Connections commented 2 years ago

Anywhere match is implemented in auto-suggest feature . Github-34