How to create a solr query that searches by multiple keywords in all fields -
i want perform solr query on fields multiple keywords. example, want search word "dog" , word "cat".
so far, i've tried this:
q=dog cat
or like:
q=dog,cat
however, think queries doing or instead of and.
your question default operator (and/or) , want search in "all fields".
for parsers can use parameter q.op
change default parser (e.g. standard query parser , dismax query parser) or can use defaultoperator in schema.xml or schema api.
be aware search in default field
.
if want search in "all fields" have copy fields 1 field (and use default field) or have list fields in dismax qf-parameter. results not same: in second case "and"-search must match 1 of fields (with special tokenizer), in first each term in different fields match (because in end terms in default field).
Comments
Post a Comment