How to search for a word in facet query in solr (or in other words how to use wildcard in search by facet)
for example
if i have facet filed MyField and it has the following values:
- ValX ValY
- ValX
- ValZ ValW
- ValX ValV
- ValA ValX
- ValA ValB
now if i search for fq=MyField:ValX
, i will get the second record only. how can i search for ValX and get the 1st, 2nd, 4th and 5th records?
you know fq=MyField:*ValX*
is not allowed and fq=MyField:ValX*
will not return the 5th record.
any idea is highly appreciated.
Wildcard card on Facet Query should work.
As wildcard queries does not undergo any analysis, you can try fq=MyField:valx*
What you are trying is not filtering but rather searching.
Use a white space tokenizer with lower case filters and search q=MyField:valx
and it would match the results. You can use prefix and wildcard queries with it as well.