I have a field which has comma separated values for e.g JSON,AngularJS and another as AngularJS,JSON and other having JSON,HTML only.
Now i have been trying to query SOLR using fq=field:(JSONAngularJS*), but it returns only the record with JSON before AngularJS.
How can i query SOLR so that it returns both the records having JSON and AngularJS but not considering the order.
Attaching SOLR Analysis for the field:
Query formed: http://localhost:8983/solr/my_core/select?fq=field:(JSON%20AND%20AngularJS)&q=:
Use a field type that is tokenized based on
,
(i.e. each entry in your list results in a separate token). You can do this by using a SimplifiedRegularExpressionPatternTokenizer:Query the index by asking for documents having both tokens present
fq=field:(JSON AND AngularJS)
.(After update of question)
First - your field seems to be a string field, and not a TextField.
To add a field through the API with the correct definition:
After adding a set of example documents:
And then querying using
fq=langs:(JSON AND AngularJS)&q=*:*)
:The document that didn't have
AngularJS
defined has been left out.