: I tried the following, edismax to search against the description field and
: lucene parser to search against the keywords field,  but it does not work.
: What is wrong?
: 
: host:port/solr/v9/select?q={!edismax qf=description}white roses OR
: {!lucene}keywords:(white AND roses)&debug=true

The {!...} local param syntax used at the begining of the q param causes 
it to specify the parser used for the entire string -- so the `edismax` 
parser is given the entire string...

        white roses OR {!lucene}keywords:(white AND roses)

...as it's input, and `edismax` does *NOT* support embeeded parsers.

In order for your (implicit `defType=lucene` parser to see that input and 
recognize that you want itto consist of SHOULD clauses, one parsed by the 
`edismax` parser, and one my the `lucene` parser you need to use parens -- 
not just for grouping, but so that the first chars of the query string 
aren't `{!...` overriding the `defType` parser.

You also need to use local params to specify the `edismax` query input as 
the `v` param, because otherwise it's up to the `defType=lucene` parser to 
decide when the prefix based input to the `edismax` ends.

So this gets you an embedded edismax parser...

q=({!edismax qf=description}white roses OR keywords:(white AND roses))

...but `white` is the query string the `defType=lucene` parser gives to 
the `edismax` parser.

This is what you seem to want...

q=({!edismax qf=description v='white roses'} OR keywords:(white AND roses))

Which can also be broken out as...

q=({!edismax qf=description v=$user_input} OR keywords:(white AND roses))
user_input=white roses

(which can be important if/when you have to worrk about quoting in your 
user input.


-Hoss
http://www.lucidworks.com/

Reply via email to