Can I have a query "near" a city override the city NLP filter?

I have a healthcare client who wants the query “dermatology near flora” to show this 1 dermatology location about 30 miles away in a neighboring city - the problem is that query selects NLP filters for “dermatology” and “flora” which yields 0 results.

I increased the location radius to 50 miles and tried to set up a query rule so that the query “dermatology near flora” adds a filter that shows the 1 location but to no avail. I think that the NLP filter for “flora” is excluding any other locations and beating out the query rule.

Any ideas?

1 Like

Hey Hannah,

You’re right in that the NLP filter for “Flora” is excluding results in other cities. I noticed you’re using an NLP filter on address.city. If you want to show results near a city, not just those that exactly match the city, you’ll want to remove this NLP filter (read more in the Answers: Healthcare Best Practices post under Exact City, State, and Zip Searches). Changing the location radius would not override the NLP filter on address.city in this case.

If this is a one-off exception and the client would like to keep exact city matches except for this one case, you could use a query rule. However, the ADD FILTER query rule you used adds an additional filter on top of the existing results. This will only narrow down the original set of results and not add any new results. To add a new result that would not appear otherwise, you would want to BOOST the entity. Check out the Query Rules module to learn more.

Hope this helps!

Thanks @Kristy_Huang - that was exactly it!