phpsolrlucenesolariumdismax

Solr dismax: How to specify a field to make a search with the parameter 'qs'?


I would to ask if someone knows how to specify a field using 'qs' parameter. I mean, for example, a have a document with this fields and content

Then i make a search by: 'premier awards' using Dismax with parameter qs: 20. So, parameters will be like:

defType:q=foo&defType=dismax&q:"premier awards"&qs:20

Results will be "name" content, right, but i just apply qs:20 to field phrase keywords, because if a search: 'goal league' is doenst match any result, although if i break the search in: "goal premier" OR goal OR premier.

Because i would like to search like this:

phrase_keywords:"goal premier" or keywords:goal OR keywords:premier

but in phrase_keywords with "qs" (proximity) and for keyword a normal search.


Solution

  • No, you couldn't specify field in qs param. Usually qs param is using with qf param, which means query fields.

    For more info on DisMax parser syntax - take a look here - https://cwiki.apache.org/confluence/display/solr/The+DisMax+Query+Parser

    About this query

    phrase_keywords:"goal premier" or keywords:goal OR keywords:premier

    I guess you could achieve it by combining several queries