valk
valk

Reputation: 9874

Querying Solr with field = string1 OR string2

I have built an index with Solr such that the following query returns a result:

http://localhost:8983/solr/db/select?q=username_s:*js*

Now I'd like to extend the results set, and in addition to js I'd like to add pa (i.e users which have "pa" as the part of their name).

I tried different things like

http://localhost:8983/solr/db/select?q=username_s:"*js* AND *pa*"

Just can't get it working. Please suggest. Thanks.

Upvotes: 1

Views: 76

Answers (1)

René
René

Reputation: 163

You can use q=username_s:(*js* *pa*), if your default-operator is set to OR (in solrconfig.xml). Alternatively you can use q=username_s:(*js* OR *pa*).

See documentation for more info's.

Upvotes: 2

Related Questions