Hi,

In the first debug query response, special words are also queries so it is not 
working.
Not sure edismax query parser recognizes _query_ field. But lucene query parser 
does.
Try to switch to lucene query parser.

Also if you can divide your query words into q and fq below will work:

q=hospital&defType=lucene&fq={!lucene q.op=AND v=$a}&a=Leapfrog


Ahmet
On Friday, May 13, 2016 9:01 AM, Bastien Latard - MDPI AG 
<lat...@mdpi.com.INVALID> wrote:



Thanks both!

I already tried "&debug=true", but it doesn't tell me that much...Or at 
least, I don't see any problem...
Below are the responses...

1. /select?q=hospital AND_query_:"{!q.op=AND 
v=$a}"&fl=abstract,title&a=hospital Leapfrog&debug=true

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">280</int>
<lst name="params">
     <str name="q">hospital AND_query_:"{!q.op=AND v=$a}"</str>
     <str name="a">hospital Leapfrog</str>
     <str name="debug">true</str>
     <str name="fl">abstract,title</str>
</lst>
</lst>
<result name="response" numFound="13642" start="0"></result>
<lst name="debug">
     <str name="rawquerystring">hospital AND_query_:"{!q.op=AND v=$a}"</str>
     <str name="querystring">hospital AND_query_:"{!q.op=AND v=$a}"</str>
     <str name="parsedquery">(+(DisjunctionMaxQuery((abstract:hospit | 
title:hospit | authors:hospital | doi:hospital)) 
DisjunctionMaxQuery(((Synonym(abstract:and abstract:andqueri) 
abstract:queri) | (Synonym(title:and title:andqueri) title:queri) | 
(Synonym(authors:and authors:andquery) authors:query) | 
doi:and_query_:)) DisjunctionMaxQuery((abstract:"(q qopand) op and (v 
va) a" | title:"(q qopand) op and (v va) a" | authors:"(q qopand) op and 
(v va) a" | doi:"{!q.op=and v=$a}"))))/no_coord</str>
     <str name="parsedquery_toString">+((abstract:hospit | title:hospit 
| authors:hospital | doi:hospital) ((Synonym(abstract:and 
abstract:andqueri) abstract:queri) | (Synonym(title:and title:andqueri) 
title:queri) | (Synonym(authors:and authors:andquery) authors:query) | 
doi:and_query_:) (abstract:"(q qopand) op and (v va) a" | title:"(q 
qopand) op and (v va) a" | authors:"(q qopand) op and (v va) a" | 
doi:"{!q.op=and v=$a}")</str>
<lst name="explain"></lst>
<str name="QParser">ExtendedDismaxQParser</str>
<null name="altquerystring"/>
<null name="boost_queries"/>
<arr name="parsed_boost_queries"/>
<null name="boostfuncs"/>
<lst name="timing">
    [...]
</lst>
</lst>
</response>


2. /select?q=_query_:"{!q.op=AND v='hospital'}"+_query_:"{!q.op=AND 
v=$a}"&a=hospital Leapfrog&debug=true

<response>
<lst name="responseHeader">
   <int name="status">0</int>
   <int name="QTime">2</int>
   <lst name="params">
     <str name="q">_query_:"{!q.op=AND v='hospital'}" 
_query_:"{!q.op=AND v=$a}"</str>
     <str name="a">hospital Leapfrog</str>
     <str name="debug">true</str>
     <str name="indent">true</str>
   </lst>
</lst>
<result name="response" numFound="0" start="0">
</result>
<lst name="debug">
   <str name="rawquerystring">_query_:"{!q.op=AND v='hospital'}" 
_query_:"{!q.op=AND v=$a}"</str>
   <str name="querystring">_query_:"{!q.op=AND v='hospital'}" 
_query_:"{!q.op=AND v=$a}"</str>
   <str name="parsedquery">(+())/no_coord</str>
   <str name="parsedquery_toString">+()</str>
   <lst name="explain"/>
   <str name="QParser">ExtendedDismaxQParser</str>
   <null name="altquerystring"/>
   <null name="boost_queries"/>
   <arr name="parsed_boost_queries"/>
   <null name="boostfuncs"/>
   <lst name="timing">
     [...]
   </lst>
</lst>
</response>

On 12/05/2016 17:06, Erick Erickson wrote:
> Try adding &debug=query to your query and look at the parsed results.
> This shows you exactly what Solr sees rather than what you think
> it should.
>
> Best,
> Erick
>
> On Thu, May 12, 2016 at 6:24 AM, Ahmet Arslan <iori...@yahoo.com.invalid> 
> wrote:
>> Hi,
>>
>> Well, what happens
>>
>> q=hospital&fq={!lucene q.op=AND v=$a}&a=hospital Leapfrog
>>
>> OR
>>
>> q=+_query_:"{!lucene q.op=AND v='hospital'}" +_query_:"{!lucene q.op=AND 
>> v=$a}"&a=hospital Leapfrog
>>
>>
>> Ahmet
>>
>>
>> On Thursday, May 12, 2016 3:28 PM, Bastien Latard - MDPI AG 
>> <lat...@mdpi.com.INVALID> wrote:
>> Hi Ahmet,
>>
>> Thanks for your answer, but this doesn't work on my local index.
>> q1 returns 2 results.
>>
>> http://localhost:8983/solr/my_core/select?q=hospital AND
>> _query_:"{!q.op=AND%20v=$a}"&fl=abstract,title&a=hospital Leapfrog
>> ==> returns 254 results (the same as
>> http://localhost:8983/solr/my_core/select?q=hospital )
>>
>> Kind regards,
>> Bastien
>>
>> On 11/05/2016 16:06, Ahmet Arslan wrote:
>>> Hi Bastien,
>>>
>>> Please use magic _query_ field, q=hospital AND _query_:"{!q.op=AND v=$a}"
>>>
>>> ahmet
>>>
>>>
>>> On Wednesday, May 11, 2016 2:35 PM, Latard - MDPI AG 
>>> <lat...@mdpi.com.INVALID> wrote:
>>> Hi Everybody,
>>>
>>> Is there a way to pass only some of the data by reference and some
>>> others in the q param?
>>>
>>> e.g.:
>>>
>>> q1.   http://localhost:8983/solr/my_core/select?{!q.op=OR
>>> v=$a}&fl=abstract,title&a=hospital Leapfrog&debug=true
>>>
>>> q1a.  http://localhost:8983/solr/my_core/select?q=hospital AND
>>> Leapfrog&fl=abstract,title
>>>
>>> q2.  http://localhost:8983/solr/my_core/select?q=hospital AND
>>> ({!q.op=AND v=$a})&fl=abstract,title&a=hospital Leapfrog
>>>
>>> q1 & q1a  are returning the same results, but q2 is somehow not
>>> analyzing the $a parameter properly...
>>>
>>> Am I missing anything?
>>>
>>> Kind regards,
>>> Bastien Latard
>>> Web engineer
>>
>> Kind regards,
>> Bastien Latard
>> Web engineer
>> --
>> MDPI AG
>> Postfach, CH-4005 Basel, Switzerland
>> Office: Klybeckstrasse 64, CH-4057
>> Tel. +41 61 683 77 35
>> Fax: +41 61 302 89 18
>> E-mail:
>> lat...@mdpi.com
>> http://www.mdpi.com/


Kind regards,
Bastien Latard
Web engineer
-- 
MDPI AG
Postfach, CH-4005 Basel, Switzerland
Office: Klybeckstrasse 64, CH-4057
Tel. +41 61 683 77 35
Fax: +41 61 302 89 18
E-mail:
lat...@mdpi.com
http://www.mdpi.com/

Reply via email to