When you mix query handlers like this you will need to add a "+" or an "AND" in 
front of the _query_: part as well, in order for it to be required.
I.e. 
hl.fragsize=0&facet=true&sort=score+desc&hl.simple.pre=<strong>&hl.fl=*&hl=true&rows=21&fl=*,score&start=0&q=%2Btag_ids:(23)++%2Bdocument_code_prefix:(A/RES/58)+AND+(_query_:"{!dismax+qf%3D'content+document_title'+pf%3D'content+document_title'+v%3D$qq}")&hl.simple.post=</strong>&facet.field={!ex%3Ddt+key%3Dorig_legal_value}legal_value&facet.field={!ex%3Ddt+key%3Dorig_adoption_year}adoption_year&facet.field={!ex%3Ddt+key%3Dorig_organisation_id}organisation_id&facet.field={!ex%3Ddt+key%3Dorig_addressee_ids}addressee_ids&facet.field={!ex%3Ddt+key%3Dorig_documenttype_id}documenttype_id&facet.field={!ex%3Ddt+key%3Dorig_information_type_id}information_type_id&facet.field={!ex%3Ddt+key%3Dorig_operative_phrase_id}operative_phrase_id&facet.field={!ex%3Ddt+key%3Dorig_tag_ids}tag_ids&qq=decade+-domestic}

You will see the difference when you try the above query directly on your Solr 
instance and add &debugQuery=true. Your parsedquerystring will show your real 
query.

BTW:
It is a better practice to submit your fielded terms as filters as they don't 
need to contribute to the score. I.e. you could rewrite your query from:
q=+tag_ids:(23)  +document_code_prefix:(A/RES/58)  (_query_:"{!dismax 
qf='content document_title' pf='content document_title' v=$qq}&qq=decade 
-domestic
to:
q=decade -domestic&defType=dismax&qf=content document_title&pf=content 
document_title&fq=tag_ids:(23)&fq=document_code_prefix:(A/RES/58)

Also, you may want to apply patch SOLR-1553 and start using the eDisMax handler 
which allows fielded search and boolean operators, if you need more advanced 
user-facing query syntax.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Training in Europe - www.solrtraining.com

On 29. juni 2010, at 14.02, Lukas Kahwe Smith wrote:

> 
> On 29.06.2010, at 13:38, Lukas Kahwe Smith wrote:
> 
>> 
>> On 29.06.2010, at 13:24, Jan Høydahl / Cominvent wrote:
>> 
>>> Hi,
>>> 
>>> In DisMax the "mm" parameter controls whether terms are required or 
>>> optional. The default is 100% which means all terms required, i.e. you do 
>>> not need to add "+". You can change to mm=0 and you will get the same 
>>> behaviour as standard parser, i.e. an "OR" behaviour, where the "+" would 
>>> say that a term is required.
>> 
>> ok thx
>> 
>>> Using the "-" in DisMax still means prohibited.
>> 
>> 
>> what do you mean with "still"? .. with the default it behaves like 
>> "optional" in my tests. i will test with mm=0 if it behaves like prohibited.
> 
> 
> maybe to illustrate the issue:
> http://resolutionfinder.org/search?q=decade+-domestic++%2Btag%3Amalaria+%2Bcode%3AA%2FRES%2F58*&tm=any&s=Search
> 
> generates the following query. note i have the standard query handler with no 
> hardcoded parameters setup as the default handler
> 
> INFO: [Clause_en] webapp=/solr path=/select 
> params={hl.fragsize=0&facet=true&sort=score+desc&hl.simple.pre=<strong>&json.nl=map&hl.fl=*&wt=json&hl=true&rows=21&fl=*,score&start=0&q=%2Btag_ids:(23)++%2Bdocument_code_prefix:(A/RES/58)++(_query_:"{!dismax+qf%3D'content+document_title'+pf%3D'content+document_title'+v%3D$qq}")&hl.simple.post=</strong>&facet.field={!ex%3Ddt+key%3Dorig_legal_value}legal_value&facet.field={!ex%3Ddt+key%3Dorig_adoption_year}adoption_year&facet.field={!ex%3Ddt+key%3Dorig_organisation_id}organisation_id&facet.field={!ex%3Ddt+key%3Dorig_addressee_ids}addressee_ids&facet.field={!ex%3Ddt+key%3Dorig_documenttype_id}documenttype_id&facet.field={!ex%3Ddt+key%3Dorig_information_type_id}information_type_id&facet.field={!ex%3Ddt+key%3Dorig_operative_phrase_id}operative_phrase_id&facet.field={!ex%3Ddt+key%3Dorig_tag_ids}tag_ids&qq=decade+-domestic}
>  hits=19 status=0 QTime=23 
> 
> I am using the dismax handler for the things that are not prefixed with a 
> field name:
> decade -domestic
> 
> I am using the default mm setting.
> 
> But if you search for "domestic" in the result of the above url you can find 
> "domestic" included in one of the results.
> 
> regards,
> Lukas Kahwe Smith
> m...@pooteeweet.org
> 
> 
> 

Reply via email to