Hello,
There have been several instances in which I have considered trying to increase the searchability of a particular field by enabling both Text Search and NLP Filter on that same field. Is there consensus related to best practices and/or potential implications of applying both of these searchable field types to the same field?
For reference, here are a few examples of fields I’ve thought to enable both search types for:
-
builtin.location - My thinking was that if someone doesn’t provide enough specificity to activate an NLP Filter, enabling Text Search could help ensure potentially relevant results are still shown.
-
Medical Specialty (whether builtin or a custom field) - Similar thinking here. If there is a longer specialty that won’t trigger the NLP unless the search is very specific, my thinking is that also having Text Search applied could increase searchability for less specific but still related queries.
Any thoughts on this would be appreciated!
Thanks,
DJ
Hey DJ,
For starters, it’s not possible to enable text search on builtin.location
or builtin.medicalSpecialty
(or any other builtin fields). Builtin fields are only searchable as NLP filters because of the unique nature of their underlying data.
For the case of location search, I have sometimes seen text search activated on the address field. In this case, the algorithm will search the actual text content of the address, rather than performing a geosearch. In general I wouldn’t recommend this but there are cases where it can be helpful.
As a more general matter, I usually wouldn’t recommend using NLP Filter and Text Search on the same field, but there are certainly exceptions. For one thing, when an NLP filter is applied those tokens are “used up” and ignored by the other parts of the Answers algorithm, so that would generally render text search search obsolete. But this behavior could actually be desirable if, for example, someone queried for a portion of an NLP filter but not the whole thing.
Hope this helps!
Max