Reputation: 553
I'd like to query a certain 2 fields in solr. Let's say I have "description" and "keywords". Now I want to search for "dogs" or "cats"
by doing this:
q=dog* OR cat*
I'm also passing the fields to be searched:
qf=description^1 keywords^1
So far so good. Now I want to have "description" to ignore the wildcards so the search is being more performant. Is there any way to do this in the fieldTypes or in the query itself?
Upvotes: 0
Views: 251
Reputation: 15791
yes, well, not exactly that, but you can get the same functionality while at the same time gaining performance:
use different analysis for description and keywords. In keywords, use a EdgeNGramFilterFactory. This can give you the same functionality as the *, but with much better perf (at the expense of a bigger index, but it is worth it!).
in description, just don't use the ngram filter, and partial matches will not be found.
Upvotes: 1