Re: Invalid parsing with solr edismax operators

2015-11-05 Thread Mahmoud Almokadem
Thanks Jack. I have reported it as a bug on JIRA 

https://issues.apache.org/jira/browse/SOLR-8237 


Mahmoud 

> On Nov 4, 2015, at 5:30 PM, Jack Krupansky  wrote:
> 
> I think you should go ahead and file a Jira ticket for this as a bug since
> either it is an actual bug or some behavior nuance that needs to be
> documented better.
> 
> -- Jack Krupansky
> 
> On Wed, Nov 4, 2015 at 8:24 AM, Mahmoud Almokadem 
> wrote:
> 
>> I removed the q.op=“AND” and add the mm=2
>> when searching for (public libraries) I got 19 with
>> "parsedquery_toString": "+(((Title:public^200.0 | TotalField:public^0.1)
>> (Title:libraries^200.0 | TotalField:libraries^0.1))~2)",
>> 
>> and when adding + and searching for +(public libraries) I got 1189 with
>> "parsedquery_toString": "+(+((Title:public^200.0 | TotalField:public^0.1)
>> (Title:libraries^200.0 | TotalField:libraries^0.1)))",
>> 
>> 
>> I think when adding + before parentheses I got all terms mandatory despite
>> the value of mm=2 in the two cases.
>> 
>> Mahmoud
>> 
>> 
>> 
>>> On Nov 4, 2015, at 3:04 PM, Alessandro Benedetti 
>> wrote:
>>> 
>>> Here we go :
>>> 
>>> Title^200 TotalField^1
>>> 
>>> + Jack explanation and you have the parsed query explained !
>>> 
>>> Cheers
>>> 
>>> On 4 November 2015 at 12:56, Mahmoud Almokadem 
>>> wrote:
>>> 
 Thank you Alessandro for your reply.
 
 Here is the request handler
 
 
 
 
explicit
  10
  TotalField
 AND
 edismax
 Title^200 TotalField^1
 

 
 
 
 
 Mahmoud
 
 
> On Nov 4, 2015, at 2:43 PM, Alessandro Benedetti <
>> abenede...@apache.org>
 wrote:
> 
> Hi Mahmoud,
> can you send us the solrconfig.xml snippet of your request handler
 please ?
> 
> It's kinda strange you get a boost factor for the Title field and that
> parsing query, according to your config.
> 
> Cheers
> 
> On 4 November 2015 at 08:39, Mahmoud Almokadem >> 
> wrote:
> 
>> Hello,
>> 
>> I'm using solr 4.8.1. Using edismax as the parser we got the
>> undesirable
>> parsed queries and results. The following is two different cases with
>> strange behavior: Searching with these parameters
>> 
>> "mm":"2",
>> "df":"TotalField",
>> "debug":"true",
>> "indent":"true",
>> "fl":"Title",
>> "start":"0",
>> "q.op":"AND",
>> "fq":"",
>> "rows":"10",
>> "wt":"json"
>> and the query is
>> 
>> "q":"+(public libraries)",
>> Retrieve 502 documents with these parsed query
>> 
>> "rawquerystring":"+(public libraries)",
>> "querystring":"+(public libraries)",
>> "parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 |
>> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
>> TotalField:libraries^0.1)/no_coord",
>> "parsedquery_toString":"+(+((Title:public^200.0 |
>> TotalField:public^0.1)
>> (Title:libraries^200.0 | TotalField:libraries^0.1)))"
>> and if the query is
>> 
>> "q":" (public libraries) "
>> then it retrieves 8 documents with these parsed query
>> 
>> "rawquerystring":" (public libraries) ",
>> "querystring":" (public libraries) ",
>> "parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 |
>> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
>> TotalField:libraries^0.1)))~2))/no_coord",
>> "parsedquery_toString":"+(((Title:public^200.0 |
>> TotalField:public^0.1)
>> (Title:libraries^200.0 | TotalField:libraries^0.1))~2)"
>> So the results of adding "+" to get all tokens before the parenthesis
>> retrieve more results than removing it.
>> 
>> Is this a bug on this version or there are something missing?
> 
> 
> 
> 
> --
> --
> 
> Benedetti Alessandro
> Visiting card : http://about.me/alessandro_benedetti
> 
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
> 
> William Blake - Songs of Experience -1794 England
 
 
>>> 
>>> 
>>> --
>>> --
>>> 
>>> Benedetti Alessandro
>>> Visiting card : http://about.me/alessandro_benedetti
>>> 
>>> "Tyger, tyger burning bright
>>> In the forests of the night,
>>> What immortal hand or eye
>>> Could frame thy fearful symmetry?"
>>> 
>>> William Blake - Songs of Experience -1794 England
>> 
>> 



Re: Invalid parsing with solr edismax operators

2015-11-05 Thread Jack Krupansky
Great. Now, we'll have to see if any enterprising committers will step up
and take a look.

-- Jack Krupansky

On Thu, Nov 5, 2015 at 4:46 AM, Mahmoud Almokadem 
wrote:

> Thanks Jack. I have reported it as a bug on JIRA
>
> https://issues.apache.org/jira/browse/SOLR-8237 <
> https://issues.apache.org/jira/browse/SOLR-8237>
>
> Mahmoud
>
> > On Nov 4, 2015, at 5:30 PM, Jack Krupansky 
> wrote:
> >
> > I think you should go ahead and file a Jira ticket for this as a bug
> since
> > either it is an actual bug or some behavior nuance that needs to be
> > documented better.
> >
> > -- Jack Krupansky
> >
> > On Wed, Nov 4, 2015 at 8:24 AM, Mahmoud Almokadem <
> prog.mahm...@gmail.com>
> > wrote:
> >
> >> I removed the q.op=“AND” and add the mm=2
> >> when searching for (public libraries) I got 19 with
> >> "parsedquery_toString": "+(((Title:public^200.0 | TotalField:public^0.1)
> >> (Title:libraries^200.0 | TotalField:libraries^0.1))~2)",
> >>
> >> and when adding + and searching for +(public libraries) I got 1189 with
> >> "parsedquery_toString": "+(+((Title:public^200.0 |
> TotalField:public^0.1)
> >> (Title:libraries^200.0 | TotalField:libraries^0.1)))",
> >>
> >>
> >> I think when adding + before parentheses I got all terms mandatory
> despite
> >> the value of mm=2 in the two cases.
> >>
> >> Mahmoud
> >>
> >>
> >>
> >>> On Nov 4, 2015, at 3:04 PM, Alessandro Benedetti <
> abenede...@apache.org>
> >> wrote:
> >>>
> >>> Here we go :
> >>>
> >>> Title^200 TotalField^1
> >>>
> >>> + Jack explanation and you have the parsed query explained !
> >>>
> >>> Cheers
> >>>
> >>> On 4 November 2015 at 12:56, Mahmoud Almokadem  >
> >>> wrote:
> >>>
>  Thank you Alessandro for your reply.
> 
>  Here is the request handler
> 
> 
>  
> 
> explicit
>   10
>   TotalField
>  AND
>  edismax
>  Title^200 TotalField^1
> 
> 
> 
>  
> 
> 
>  Mahmoud
> 
> 
> > On Nov 4, 2015, at 2:43 PM, Alessandro Benedetti <
> >> abenede...@apache.org>
>  wrote:
> >
> > Hi Mahmoud,
> > can you send us the solrconfig.xml snippet of your request handler
>  please ?
> >
> > It's kinda strange you get a boost factor for the Title field and
> that
> > parsing query, according to your config.
> >
> > Cheers
> >
> > On 4 November 2015 at 08:39, Mahmoud Almokadem <
> prog.mahm...@gmail.com
> >>>
> > wrote:
> >
> >> Hello,
> >>
> >> I'm using solr 4.8.1. Using edismax as the parser we got the
> >> undesirable
> >> parsed queries and results. The following is two different cases
> with
> >> strange behavior: Searching with these parameters
> >>
> >> "mm":"2",
> >> "df":"TotalField",
> >> "debug":"true",
> >> "indent":"true",
> >> "fl":"Title",
> >> "start":"0",
> >> "q.op":"AND",
> >> "fq":"",
> >> "rows":"10",
> >> "wt":"json"
> >> and the query is
> >>
> >> "q":"+(public libraries)",
> >> Retrieve 502 documents with these parsed query
> >>
> >> "rawquerystring":"+(public libraries)",
> >> "querystring":"+(public libraries)",
> >> "parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 |
> >> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
> >> TotalField:libraries^0.1)/no_coord",
> >> "parsedquery_toString":"+(+((Title:public^200.0 |
> >> TotalField:public^0.1)
> >> (Title:libraries^200.0 | TotalField:libraries^0.1)))"
> >> and if the query is
> >>
> >> "q":" (public libraries) "
> >> then it retrieves 8 documents with these parsed query
> >>
> >> "rawquerystring":" (public libraries) ",
> >> "querystring":" (public libraries) ",
> >> "parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 |
> >> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
> >> TotalField:libraries^0.1)))~2))/no_coord",
> >> "parsedquery_toString":"+(((Title:public^200.0 |
> >> TotalField:public^0.1)
> >> (Title:libraries^200.0 | TotalField:libraries^0.1))~2)"
> >> So the results of adding "+" to get all tokens before the
> parenthesis
> >> retrieve more results than removing it.
> >>
> >> Is this a bug on this version or there are something missing?
> >
> >
> >
> >
> > --
> > --
> >
> > Benedetti Alessandro
> > Visiting card : http://about.me/alessandro_benedetti
> >
> > "Tyger, tyger burning bright
> > In the forests of the night,
> > What immortal hand or eye
> > Could frame thy fearful symmetry?"
> >
> > William Blake - Songs of Experience -1794 England
> 
> 
> >>>
> >>>
> >>> --
> >>> --
> >>>
> >>> Benedetti Alessandro
> >>> Visiting card : http://about.me/alessandro_benedetti
> >>>
> 

Re: Invalid parsing with solr edismax operators

2015-11-04 Thread Alessandro Benedetti
Here we go :

Title^200 TotalField^1

+ Jack explanation and you have the parsed query explained !

Cheers

On 4 November 2015 at 12:56, Mahmoud Almokadem 
wrote:

> Thank you Alessandro for your reply.
>
> Here is the request handler
>
>
> 
>
>  explicit
>10
>TotalField
>   AND
>   edismax
>   Title^200 TotalField^1
>
>  
>
> 
>
>
> Mahmoud
>
>
> > On Nov 4, 2015, at 2:43 PM, Alessandro Benedetti 
> wrote:
> >
> > Hi Mahmoud,
> > can you send us the solrconfig.xml snippet of your request handler
> please ?
> >
> > It's kinda strange you get a boost factor for the Title field and that
> > parsing query, according to your config.
> >
> > Cheers
> >
> > On 4 November 2015 at 08:39, Mahmoud Almokadem 
> > wrote:
> >
> >> Hello,
> >>
> >> I'm using solr 4.8.1. Using edismax as the parser we got the undesirable
> >> parsed queries and results. The following is two different cases with
> >> strange behavior: Searching with these parameters
> >>
> >>  "mm":"2",
> >>  "df":"TotalField",
> >>  "debug":"true",
> >>  "indent":"true",
> >>  "fl":"Title",
> >>  "start":"0",
> >>  "q.op":"AND",
> >>  "fq":"",
> >>  "rows":"10",
> >>  "wt":"json"
> >> and the query is
> >>
> >> "q":"+(public libraries)",
> >> Retrieve 502 documents with these parsed query
> >>
> >> "rawquerystring":"+(public libraries)",
> >> "querystring":"+(public libraries)",
> >> "parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 |
> >> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
> >> TotalField:libraries^0.1)/no_coord",
> >> "parsedquery_toString":"+(+((Title:public^200.0 | TotalField:public^0.1)
> >> (Title:libraries^200.0 | TotalField:libraries^0.1)))"
> >> and if the query is
> >>
> >> "q":" (public libraries) "
> >> then it retrieves 8 documents with these parsed query
> >>
> >> "rawquerystring":" (public libraries) ",
> >> "querystring":" (public libraries) ",
> >> "parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 |
> >> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
> >> TotalField:libraries^0.1)))~2))/no_coord",
> >> "parsedquery_toString":"+(((Title:public^200.0 | TotalField:public^0.1)
> >> (Title:libraries^200.0 | TotalField:libraries^0.1))~2)"
> >> So the results of adding "+" to get all tokens before the parenthesis
> >> retrieve more results than removing it.
> >>
> >> Is this a bug on this version or there are something missing?
> >
> >
> >
> >
> > --
> > --
> >
> > Benedetti Alessandro
> > Visiting card : http://about.me/alessandro_benedetti
> >
> > "Tyger, tyger burning bright
> > In the forests of the night,
> > What immortal hand or eye
> > Could frame thy fearful symmetry?"
> >
> > William Blake - Songs of Experience -1794 England
>
>


-- 
--

Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England


Re: Invalid parsing with solr edismax operators

2015-11-04 Thread Alessandro Benedetti
Hi Mahmoud,
can you send us the solrconfig.xml snippet of your request handler please ?

It's kinda strange you get a boost factor for the Title field and that
parsing query, according to your config.

Cheers

On 4 November 2015 at 08:39, Mahmoud Almokadem 
wrote:

> Hello,
>
> I'm using solr 4.8.1. Using edismax as the parser we got the undesirable
> parsed queries and results. The following is two different cases with
> strange behavior: Searching with these parameters
>
>   "mm":"2",
>   "df":"TotalField",
>   "debug":"true",
>   "indent":"true",
>   "fl":"Title",
>   "start":"0",
>   "q.op":"AND",
>   "fq":"",
>   "rows":"10",
>   "wt":"json"
> and the query is
>
> "q":"+(public libraries)",
> Retrieve 502 documents with these parsed query
>
> "rawquerystring":"+(public libraries)",
> "querystring":"+(public libraries)",
> "parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 |
> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
> TotalField:libraries^0.1)/no_coord",
> "parsedquery_toString":"+(+((Title:public^200.0 | TotalField:public^0.1)
> (Title:libraries^200.0 | TotalField:libraries^0.1)))"
> and if the query is
>
> "q":" (public libraries) "
> then it retrieves 8 documents with these parsed query
>
> "rawquerystring":" (public libraries) ",
> "querystring":" (public libraries) ",
> "parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 |
> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
> TotalField:libraries^0.1)))~2))/no_coord",
> "parsedquery_toString":"+(((Title:public^200.0 | TotalField:public^0.1)
> (Title:libraries^200.0 | TotalField:libraries^0.1))~2)"
> So the results of adding "+" to get all tokens before the parenthesis
> retrieve more results than removing it.
>
> Is this a bug on this version or there are something missing?




-- 
--

Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England


Re: Invalid parsing with solr edismax operators

2015-11-04 Thread Mahmoud Almokadem
Thank you Alessandro for your reply. 

Here is the request handler 




 explicit
   10
   TotalField
  AND
  edismax
  Title^200 TotalField^1
   
 




Mahmoud


> On Nov 4, 2015, at 2:43 PM, Alessandro Benedetti  
> wrote:
> 
> Hi Mahmoud,
> can you send us the solrconfig.xml snippet of your request handler please ?
> 
> It's kinda strange you get a boost factor for the Title field and that
> parsing query, according to your config.
> 
> Cheers
> 
> On 4 November 2015 at 08:39, Mahmoud Almokadem 
> wrote:
> 
>> Hello,
>> 
>> I'm using solr 4.8.1. Using edismax as the parser we got the undesirable
>> parsed queries and results. The following is two different cases with
>> strange behavior: Searching with these parameters
>> 
>>  "mm":"2",
>>  "df":"TotalField",
>>  "debug":"true",
>>  "indent":"true",
>>  "fl":"Title",
>>  "start":"0",
>>  "q.op":"AND",
>>  "fq":"",
>>  "rows":"10",
>>  "wt":"json"
>> and the query is
>> 
>> "q":"+(public libraries)",
>> Retrieve 502 documents with these parsed query
>> 
>> "rawquerystring":"+(public libraries)",
>> "querystring":"+(public libraries)",
>> "parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 |
>> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
>> TotalField:libraries^0.1)/no_coord",
>> "parsedquery_toString":"+(+((Title:public^200.0 | TotalField:public^0.1)
>> (Title:libraries^200.0 | TotalField:libraries^0.1)))"
>> and if the query is
>> 
>> "q":" (public libraries) "
>> then it retrieves 8 documents with these parsed query
>> 
>> "rawquerystring":" (public libraries) ",
>> "querystring":" (public libraries) ",
>> "parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 |
>> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
>> TotalField:libraries^0.1)))~2))/no_coord",
>> "parsedquery_toString":"+(((Title:public^200.0 | TotalField:public^0.1)
>> (Title:libraries^200.0 | TotalField:libraries^0.1))~2)"
>> So the results of adding "+" to get all tokens before the parenthesis
>> retrieve more results than removing it.
>> 
>> Is this a bug on this version or there are something missing?
> 
> 
> 
> 
> -- 
> --
> 
> Benedetti Alessandro
> Visiting card : http://about.me/alessandro_benedetti
> 
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
> 
> William Blake - Songs of Experience -1794 England



Re: Invalid parsing with solr edismax operators

2015-11-04 Thread Jack Krupansky
It is debatable whether this is a bug or just a poorly documented
interaction of q.op, mm, and nested queries (within parentheses.)
Personally, I'd say it is a bug. Edismax is only obeying q.op and mm for
the top-level of the query - once you nest within parentheses the default
operator reverts to Lucene's internal default of OR. Why the second query
is treated differently with regard to those parentheses is baffling, some
quirk of the query parser, which few people have a solid handle on. I
suspect that the fact that there is no additional query terms or operators
around those top-level parentheses is causing the query parser logic to act
as if the parentheses were not there.

You neglected to give us your qf parameter, but obviously it is:
qf=Title^200.0 TotalField, I think.

-- Jack Krupansky

On Wed, Nov 4, 2015 at 3:39 AM, Mahmoud Almokadem 
wrote:

> Hello,
>
> I'm using solr 4.8.1. Using edismax as the parser we got the undesirable
> parsed queries and results. The following is two different cases with
> strange behavior: Searching with these parameters
>
>   "mm":"2",
>   "df":"TotalField",
>   "debug":"true",
>   "indent":"true",
>   "fl":"Title",
>   "start":"0",
>   "q.op":"AND",
>   "fq":"",
>   "rows":"10",
>   "wt":"json"
> and the query is
>
> "q":"+(public libraries)",
> Retrieve 502 documents with these parsed query
>
> "rawquerystring":"+(public libraries)",
> "querystring":"+(public libraries)",
> "parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 |
> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
> TotalField:libraries^0.1)/no_coord",
> "parsedquery_toString":"+(+((Title:public^200.0 | TotalField:public^0.1)
> (Title:libraries^200.0 | TotalField:libraries^0.1)))"
> and if the query is
>
> "q":" (public libraries) "
> then it retrieves 8 documents with these parsed query
>
> "rawquerystring":" (public libraries) ",
> "querystring":" (public libraries) ",
> "parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 |
> TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
> TotalField:libraries^0.1)))~2))/no_coord",
> "parsedquery_toString":"+(((Title:public^200.0 | TotalField:public^0.1)
> (Title:libraries^200.0 | TotalField:libraries^0.1))~2)"
> So the results of adding "+" to get all tokens before the parenthesis
> retrieve more results than removing it.
>
> Is this a bug on this version or there are something missing?


Re: Invalid parsing with solr edismax operators

2015-11-04 Thread Mahmoud Almokadem
I removed the q.op=“AND” and add the mm=2
when searching for (public libraries) I got 19 with "parsedquery_toString": 
"+(((Title:public^200.0 | TotalField:public^0.1) (Title:libraries^200.0 | 
TotalField:libraries^0.1))~2)",

and when adding + and searching for +(public libraries) I got 1189 with
"parsedquery_toString": "+(+((Title:public^200.0 | TotalField:public^0.1) 
(Title:libraries^200.0 | TotalField:libraries^0.1)))",


I think when adding + before parentheses I got all terms mandatory despite the 
value of mm=2 in the two cases.

Mahmoud



> On Nov 4, 2015, at 3:04 PM, Alessandro Benedetti  
> wrote:
> 
> Here we go :
> 
> Title^200 TotalField^1
> 
> + Jack explanation and you have the parsed query explained !
> 
> Cheers
> 
> On 4 November 2015 at 12:56, Mahmoud Almokadem 
> wrote:
> 
>> Thank you Alessandro for your reply.
>> 
>> Here is the request handler
>> 
>> 
>> 
>> 
>> explicit
>>   10
>>   TotalField
>>  AND
>>  edismax
>>  Title^200 TotalField^1
>> 
>> 
>> 
>> 
>> 
>> 
>> Mahmoud
>> 
>> 
>>> On Nov 4, 2015, at 2:43 PM, Alessandro Benedetti 
>> wrote:
>>> 
>>> Hi Mahmoud,
>>> can you send us the solrconfig.xml snippet of your request handler
>> please ?
>>> 
>>> It's kinda strange you get a boost factor for the Title field and that
>>> parsing query, according to your config.
>>> 
>>> Cheers
>>> 
>>> On 4 November 2015 at 08:39, Mahmoud Almokadem 
>>> wrote:
>>> 
 Hello,
 
 I'm using solr 4.8.1. Using edismax as the parser we got the undesirable
 parsed queries and results. The following is two different cases with
 strange behavior: Searching with these parameters
 
 "mm":"2",
 "df":"TotalField",
 "debug":"true",
 "indent":"true",
 "fl":"Title",
 "start":"0",
 "q.op":"AND",
 "fq":"",
 "rows":"10",
 "wt":"json"
 and the query is
 
 "q":"+(public libraries)",
 Retrieve 502 documents with these parsed query
 
 "rawquerystring":"+(public libraries)",
 "querystring":"+(public libraries)",
 "parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 |
 TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
 TotalField:libraries^0.1)/no_coord",
 "parsedquery_toString":"+(+((Title:public^200.0 | TotalField:public^0.1)
 (Title:libraries^200.0 | TotalField:libraries^0.1)))"
 and if the query is
 
 "q":" (public libraries) "
 then it retrieves 8 documents with these parsed query
 
 "rawquerystring":" (public libraries) ",
 "querystring":" (public libraries) ",
 "parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 |
 TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
 TotalField:libraries^0.1)))~2))/no_coord",
 "parsedquery_toString":"+(((Title:public^200.0 | TotalField:public^0.1)
 (Title:libraries^200.0 | TotalField:libraries^0.1))~2)"
 So the results of adding "+" to get all tokens before the parenthesis
 retrieve more results than removing it.
 
 Is this a bug on this version or there are something missing?
>>> 
>>> 
>>> 
>>> 
>>> --
>>> --
>>> 
>>> Benedetti Alessandro
>>> Visiting card : http://about.me/alessandro_benedetti
>>> 
>>> "Tyger, tyger burning bright
>>> In the forests of the night,
>>> What immortal hand or eye
>>> Could frame thy fearful symmetry?"
>>> 
>>> William Blake - Songs of Experience -1794 England
>> 
>> 
> 
> 
> -- 
> --
> 
> Benedetti Alessandro
> Visiting card : http://about.me/alessandro_benedetti
> 
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
> 
> William Blake - Songs of Experience -1794 England



Re: Invalid parsing with solr edismax operators

2015-11-04 Thread Jack Krupansky
I think you should go ahead and file a Jira ticket for this as a bug since
either it is an actual bug or some behavior nuance that needs to be
documented better.

-- Jack Krupansky

On Wed, Nov 4, 2015 at 8:24 AM, Mahmoud Almokadem 
wrote:

> I removed the q.op=“AND” and add the mm=2
> when searching for (public libraries) I got 19 with
>  "parsedquery_toString": "+(((Title:public^200.0 | TotalField:public^0.1)
> (Title:libraries^200.0 | TotalField:libraries^0.1))~2)",
>
> and when adding + and searching for +(public libraries) I got 1189 with
> "parsedquery_toString": "+(+((Title:public^200.0 | TotalField:public^0.1)
> (Title:libraries^200.0 | TotalField:libraries^0.1)))",
>
>
> I think when adding + before parentheses I got all terms mandatory despite
> the value of mm=2 in the two cases.
>
> Mahmoud
>
>
>
> > On Nov 4, 2015, at 3:04 PM, Alessandro Benedetti 
> wrote:
> >
> > Here we go :
> >
> > Title^200 TotalField^1
> >
> > + Jack explanation and you have the parsed query explained !
> >
> > Cheers
> >
> > On 4 November 2015 at 12:56, Mahmoud Almokadem 
> > wrote:
> >
> >> Thank you Alessandro for your reply.
> >>
> >> Here is the request handler
> >>
> >>
> >> 
> >>
> >> explicit
> >>   10
> >>   TotalField
> >>  AND
> >>  edismax
> >>  Title^200 TotalField^1
> >>
> >> 
> >>
> >> 
> >>
> >>
> >> Mahmoud
> >>
> >>
> >>> On Nov 4, 2015, at 2:43 PM, Alessandro Benedetti <
> abenede...@apache.org>
> >> wrote:
> >>>
> >>> Hi Mahmoud,
> >>> can you send us the solrconfig.xml snippet of your request handler
> >> please ?
> >>>
> >>> It's kinda strange you get a boost factor for the Title field and that
> >>> parsing query, according to your config.
> >>>
> >>> Cheers
> >>>
> >>> On 4 November 2015 at 08:39, Mahmoud Almokadem  >
> >>> wrote:
> >>>
>  Hello,
> 
>  I'm using solr 4.8.1. Using edismax as the parser we got the
> undesirable
>  parsed queries and results. The following is two different cases with
>  strange behavior: Searching with these parameters
> 
>  "mm":"2",
>  "df":"TotalField",
>  "debug":"true",
>  "indent":"true",
>  "fl":"Title",
>  "start":"0",
>  "q.op":"AND",
>  "fq":"",
>  "rows":"10",
>  "wt":"json"
>  and the query is
> 
>  "q":"+(public libraries)",
>  Retrieve 502 documents with these parsed query
> 
>  "rawquerystring":"+(public libraries)",
>  "querystring":"+(public libraries)",
>  "parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 |
>  TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
>  TotalField:libraries^0.1)/no_coord",
>  "parsedquery_toString":"+(+((Title:public^200.0 |
> TotalField:public^0.1)
>  (Title:libraries^200.0 | TotalField:libraries^0.1)))"
>  and if the query is
> 
>  "q":" (public libraries) "
>  then it retrieves 8 documents with these parsed query
> 
>  "rawquerystring":" (public libraries) ",
>  "querystring":" (public libraries) ",
>  "parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 |
>  TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
>  TotalField:libraries^0.1)))~2))/no_coord",
>  "parsedquery_toString":"+(((Title:public^200.0 |
> TotalField:public^0.1)
>  (Title:libraries^200.0 | TotalField:libraries^0.1))~2)"
>  So the results of adding "+" to get all tokens before the parenthesis
>  retrieve more results than removing it.
> 
>  Is this a bug on this version or there are something missing?
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> --
> >>>
> >>> Benedetti Alessandro
> >>> Visiting card : http://about.me/alessandro_benedetti
> >>>
> >>> "Tyger, tyger burning bright
> >>> In the forests of the night,
> >>> What immortal hand or eye
> >>> Could frame thy fearful symmetry?"
> >>>
> >>> William Blake - Songs of Experience -1794 England
> >>
> >>
> >
> >
> > --
> > --
> >
> > Benedetti Alessandro
> > Visiting card : http://about.me/alessandro_benedetti
> >
> > "Tyger, tyger burning bright
> > In the forests of the night,
> > What immortal hand or eye
> > Could frame thy fearful symmetry?"
> >
> > William Blake - Songs of Experience -1794 England
>
>


Invalid parsing with solr edismax operators

2015-11-04 Thread Mahmoud Almokadem
Hello, 

I'm using solr 4.8.1. Using edismax as the parser we got the undesirable parsed 
queries and results. The following is two different cases with strange 
behavior: Searching with these parameters

  "mm":"2",
  "df":"TotalField",
  "debug":"true",
  "indent":"true",
  "fl":"Title",
  "start":"0",
  "q.op":"AND",
  "fq":"",
  "rows":"10",
  "wt":"json" 
and the query is

"q":"+(public libraries)",
Retrieve 502 documents with these parsed query

"rawquerystring":"+(public libraries)",
"querystring":"+(public libraries)",
"parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 | 
TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 | 
TotalField:libraries^0.1)/no_coord",
"parsedquery_toString":"+(+((Title:public^200.0 | TotalField:public^0.1) 
(Title:libraries^200.0 | TotalField:libraries^0.1)))"
and if the query is

"q":" (public libraries) "
then it retrieves 8 documents with these parsed query

"rawquerystring":" (public libraries) ",
"querystring":" (public libraries) ",
"parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 | 
TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 | 
TotalField:libraries^0.1)))~2))/no_coord",
"parsedquery_toString":"+(((Title:public^200.0 | TotalField:public^0.1) 
(Title:libraries^200.0 | TotalField:libraries^0.1))~2)"
So the results of adding "+" to get all tokens before the parenthesis retrieve 
more results than removing it.

Is this a bug on this version or there are something missing?

Invalid parsing with solr edismax operators

2015-11-01 Thread Mahmoud Almokadem
Hello,

I'm using solr 4.8.1. Using edismax as the parser we got the undesirable
parsed queries and results. The following is two different cases with
strange behavior: Searching with these parameters

  "mm":"2",
  "df":"TotalField",
  "debug":"true",
  "indent":"true",
  "fl":"Title",
  "start":"0",
  "q.op":"AND",
  "fq":"",
  "rows":"10",
  "wt":"json"

and the query is

"q":"+(public libraries)",

Retrieve 502 documents with these parsed query

"rawquerystring":"+(public libraries)",
"querystring":"+(public libraries)",
"parsedquery":"(+(+(DisjunctionMaxQuery((Title:public^200.0 |
TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
TotalField:libraries^0.1)/no_coord",
"parsedquery_toString":"+(+((Title:public^200.0 |
TotalField:public^0.1) (Title:libraries^200.0 |
TotalField:libraries^0.1)))"

and if the query is

"q":" (public libraries) "

then it retrieves 8 documents with these parsed query

"rawquerystring":" (public libraries) ",
"querystring":" (public libraries) ",
"parsedquery":"(+((DisjunctionMaxQuery((Title:public^200.0 |
TotalField:public^0.1)) DisjunctionMaxQuery((Title:libraries^200.0 |
TotalField:libraries^0.1)))~2))/no_coord",
"parsedquery_toString":"+(((Title:public^200.0 |
TotalField:public^0.1) (Title:libraries^200.0 |
TotalField:libraries^0.1))~2)"

So the results of adding "+" to get all tokens before the parenthesis
retrieve more results than removing it.

Is this a bug on this version or there are something missing?


edismax operators

2015-04-02 Thread Mahmoud Almokadem
Hello,

I've a strange behaviour on using edismax with multiwords. When using
passing q=+(word1 word2) I got

rawquerystring: +(word1 word2), querystring: +(word1 word2), 
parsedquery: (+(+(DisjunctionMaxQuery((title:word1))
DisjunctionMaxQuery((title:word2)/no_coord,
parsedquery_toString: +(+((title:word1)
(title:word2))),

I expected to get two words as must as I added + before the parentheses
so It must be applied for all terms in parentheses.

How can I apply default operator AND for all words.

Thanks,
Mahmoud


Re: edismax operators

2015-04-02 Thread Jack Krupansky
The parentheses signal a nested query. Your plus operator applies to the
overall nested query - that the nested query must match something. Use the
plus operator on each of the discrete terms if each of them is mandatory.
The plus and minus operators apply to the overall nested query - they do
not distribute to each term within the nested query. They don't magically
distribute to all nested queries.

Let's see you full set of query parameters, both on the request and in
solrconfig.

-- Jack Krupansky

On Thu, Apr 2, 2015 at 7:12 AM, Mahmoud Almokadem prog.mahm...@gmail.com
wrote:

 Hello,

 I've a strange behaviour on using edismax with multiwords. When using
 passing q=+(word1 word2) I got

 rawquerystring: +(word1 word2), querystring: +(word1 word2), 
 parsedquery: (+(+(DisjunctionMaxQuery((title:word1))
 DisjunctionMaxQuery((title:word2)/no_coord,
 parsedquery_toString: +(+((title:word1)
 (title:word2))),

 I expected to get two words as must as I added + before the parentheses
 so It must be applied for all terms in parentheses.

 How can I apply default operator AND for all words.

 Thanks,
 Mahmoud



Re: edismax operators

2015-04-02 Thread Shawn Heisey
On 4/2/2015 8:35 AM, Mahmoud Almokadem wrote:
 Thank you Jack for your clarifications. I used regular defType and set
 q.op=AND so all terms without operators are must. How can I use this with
 edismax?

The edismax parser is capable of much more granularity than simply
AND/OR on the default operator, through the mm parameter.  If you set
q.op to AND, the mm parameter will be set to 100%.  The mm parameter is
EXTREMELY flexible.

https://wiki.apache.org/solr/ExtendedDisMax#mm_.28Minimum_.27Should.27_Match.29

Thanks,
Shawn



RE: edismax operators

2015-04-02 Thread Davis, Daniel (NIH/NLM) [C]
Can the mm parameter be set per clause?I guess I've ignored it in the past 
aside from setting it once to what seemed like a reasonable value.
That is probably replicated across every collection, which cannot be ideal for 
relevance.

-Original Message-
From: Shawn Heisey [mailto:apa...@elyograg.org] 
Sent: Thursday, April 02, 2015 11:13 AM
To: solr-user@lucene.apache.org
Subject: Re: edismax operators

On 4/2/2015 8:35 AM, Mahmoud Almokadem wrote:
 Thank you Jack for your clarifications. I used regular defType and set 
 q.op=AND so all terms without operators are must. How can I use this 
 with edismax?

The edismax parser is capable of much more granularity than simply AND/OR on 
the default operator, through the mm parameter.  If you set q.op to AND, the mm 
parameter will be set to 100%.  The mm parameter is EXTREMELY flexible.

https://wiki.apache.org/solr/ExtendedDisMax#mm_.28Minimum_.27Should.27_Match.29

Thanks,
Shawn



Re: edismax operators

2015-04-02 Thread Mahmoud Almokadem
Thank you Jack for your clarifications. I used regular defType and set
q.op=AND so all terms without operators are must. How can I use this with
edismax?

Thanks,
Mahmoud

On Thu, Apr 2, 2015 at 2:14 PM, Jack Krupansky jack.krupan...@gmail.com
wrote:

 The parentheses signal a nested query. Your plus operator applies to the
 overall nested query - that the nested query must match something. Use the
 plus operator on each of the discrete terms if each of them is mandatory.
 The plus and minus operators apply to the overall nested query - they do
 not distribute to each term within the nested query. They don't magically
 distribute to all nested queries.

 Let's see you full set of query parameters, both on the request and in
 solrconfig.

 -- Jack Krupansky

 On Thu, Apr 2, 2015 at 7:12 AM, Mahmoud Almokadem prog.mahm...@gmail.com
 wrote:

  Hello,
 
  I've a strange behaviour on using edismax with multiwords. When using
  passing q=+(word1 word2) I got
 
  rawquerystring: +(word1 word2), querystring: +(word1 word2), 
  parsedquery: (+(+(DisjunctionMaxQuery((title:word1))
  DisjunctionMaxQuery((title:word2)/no_coord,
  parsedquery_toString: +(+((title:word1)
  (title:word2))),
 
  I expected to get two words as must as I added + before the parentheses
  so It must be applied for all terms in parentheses.
 
  How can I apply default operator AND for all words.
 
  Thanks,
  Mahmoud
 



RE: edismax operators

2015-04-02 Thread Davis, Daniel (NIH/NLM) [C]
Thanks Shawn,

This is what I thought, but Solr often has features I don't anticipate.

-Original Message-
From: Shawn Heisey [mailto:apa...@elyograg.org] 
Sent: Thursday, April 02, 2015 12:54 PM
To: solr-user@lucene.apache.org
Subject: Re: edismax operators

On 4/2/2015 9:59 AM, Davis, Daniel (NIH/NLM) [C] wrote:
 Can the mm parameter be set per clause?I guess I've ignored it in the 
 past aside from setting it once to what seemed like a reasonable value.
 That is probably replicated across every collection, which cannot be ideal 
 for relevance.

It applies to the whole query.  You can have a different value on every query 
you send.  Just like with other parameters, defaults can be configured in the 
solrconfig.xml request handler definition.

Thanks,
Shawn



Re: edismax operators

2015-04-02 Thread Mahmoud Almokadem
Thanks all for you response,

But the parsed_query and number of results still when changing MM parameter

the following results for mm=100% and mm=0%

http://solrserver/solr/collection1/select?q=%2B(word1+word2)rows=0fl=Titlewt=jsonindent=truedebugQuery=truedefType=edismaxqf=titlemm=100%25stopwords=truelowercaseOperators=true
http://10.1.1.118:8090/solr/PAEB/select?q=%2B(word1+word2)rows=0fl=Titlewt=jsonindent=truedebugQuery=truedefType=edismaxqf=titlemm=100%25stopwords=truelowercaseOperators=true

rawquerystring: +(word1 word2), querystring: +(word1 word2),
parsedquery: (+(+(DisjunctionMaxQuery((title:word1))
DisjunctionMaxQuery((title:word2)/no_coord,
parsedquery_toString: +(+((title:word1) (title:word2)))”,



http://solrserver/solr/collection1/select?q=%2B(word1+word2)rows=0fl=Titlewt=jsonindent=truedebugQuery=truedefType=edismaxqf=titlemm=0%25stopwords=truelowercaseOperators=true
http://10.1.1.118:8090/solr/PAEB/select?q=%2B(word1+word2)rows=0fl=Titlewt=jsonindent=truedebugQuery=truedefType=edismaxqf=titlemm=100%25stopwords=truelowercaseOperators=true

rawquerystring: +(word1 word2), querystring: +(word1 word2),
parsedquery: (+(+(DisjunctionMaxQuery((title:word1))
DisjunctionMaxQuery((title:word2)/no_coord,
parsedquery_toString: +(+((title:word1) (title:word2))),

There are any changes on two queries

solr version 4.8.1

Thanks,
Mahmoud

On Thu, Apr 2, 2015 at 6:56 PM, Davis, Daniel (NIH/NLM) [C] 
daniel.da...@nih.gov wrote:

 Thanks Shawn,

 This is what I thought, but Solr often has features I don't anticipate.

 -Original Message-
 From: Shawn Heisey [mailto:apa...@elyograg.org]
 Sent: Thursday, April 02, 2015 12:54 PM
 To: solr-user@lucene.apache.org
 Subject: Re: edismax operators

 On 4/2/2015 9:59 AM, Davis, Daniel (NIH/NLM) [C] wrote:
  Can the mm parameter be set per clause?I guess I've ignored it in
 the past aside from setting it once to what seemed like a reasonable value.
  That is probably replicated across every collection, which cannot be
 ideal for relevance.

 It applies to the whole query.  You can have a different value on every
 query you send.  Just like with other parameters, defaults can be
 configured in the solrconfig.xml request handler definition.

 Thanks,
 Shawn




Re: edismax operators

2015-04-02 Thread Erick Erickson
The MM parameter is specific to the handler you set up/use, so it's
really on a per collection basis. Different collections can specify
this however they want.

Or I misunderstand what you're asking..

Best,
Erick

On Thu, Apr 2, 2015 at 8:59 AM, Davis, Daniel (NIH/NLM) [C]
daniel.da...@nih.gov wrote:
 Can the mm parameter be set per clause?I guess I've ignored it in the 
 past aside from setting it once to what seemed like a reasonable value.
 That is probably replicated across every collection, which cannot be ideal 
 for relevance.

 -Original Message-
 From: Shawn Heisey [mailto:apa...@elyograg.org]
 Sent: Thursday, April 02, 2015 11:13 AM
 To: solr-user@lucene.apache.org
 Subject: Re: edismax operators

 On 4/2/2015 8:35 AM, Mahmoud Almokadem wrote:
 Thank you Jack for your clarifications. I used regular defType and set
 q.op=AND so all terms without operators are must. How can I use this
 with edismax?

 The edismax parser is capable of much more granularity than simply AND/OR on 
 the default operator, through the mm parameter.  If you set q.op to AND, the 
 mm parameter will be set to 100%.  The mm parameter is EXTREMELY flexible.

 https://wiki.apache.org/solr/ExtendedDisMax#mm_.28Minimum_.27Should.27_Match.29

 Thanks,
 Shawn



Re: edismax operators

2015-04-02 Thread Shawn Heisey
On 4/2/2015 9:59 AM, Davis, Daniel (NIH/NLM) [C] wrote:
 Can the mm parameter be set per clause?I guess I've ignored it in the 
 past aside from setting it once to what seemed like a reasonable value.
 That is probably replicated across every collection, which cannot be ideal 
 for relevance.

It applies to the whole query.  You can have a different value on every
query you send.  Just like with other parameters, defaults can be
configured in the solrconfig.xml request handler definition.

Thanks,
Shawn




Re: edismax operators

2015-04-02 Thread Jack Krupansky
Personally, I am not convinced how the q.op and mm parameters are really
handled within nested queries. There have been bugs in edismax and some
oddities for how it does work. I have personally given up on figuring out
how the code works. At one stage, back in the days when I did feel that I
had a handle on the code, the q.op/mm logic seemed to apply only to the
outer, top level of the query, not to the nested terms of the query, but my
recollection could be faulty on that specific point, and it may have
changed as some bugs have been fixed.

So, I would suggest that you file a Jira and let the committers sort out
whether it is really a bug or simply needs better doc for its expected
behavior on this specific issue.

-- Jack Krupansky

On Thu, Apr 2, 2015 at 1:02 PM, Mahmoud Almokadem prog.mahm...@gmail.com
wrote:

 Thanks all for you response,

 But the parsed_query and number of results still when changing MM parameter

 the following results for mm=100% and mm=0%


 http://solrserver/solr/collection1/select?q=%2B(word1+word2)rows=0fl=Titlewt=jsonindent=truedebugQuery=truedefType=edismaxqf=titlemm=100%25stopwords=truelowercaseOperators=true
 
 http://10.1.1.118:8090/solr/PAEB/select?q=%2B(word1+word2)rows=0fl=Titlewt=jsonindent=truedebugQuery=truedefType=edismaxqf=titlemm=100%25stopwords=truelowercaseOperators=true
 

 rawquerystring: +(word1 word2), querystring: +(word1 word2),
 parsedquery: (+(+(DisjunctionMaxQuery((title:word1))
 DisjunctionMaxQuery((title:word2)/no_coord,
 parsedquery_toString: +(+((title:word1) (title:word2)))”,




 http://solrserver/solr/collection1/select?q=%2B(word1+word2)rows=0fl=Titlewt=jsonindent=truedebugQuery=truedefType=edismaxqf=titlemm=0%25stopwords=truelowercaseOperators=true
 
 http://10.1.1.118:8090/solr/PAEB/select?q=%2B(word1+word2)rows=0fl=Titlewt=jsonindent=truedebugQuery=truedefType=edismaxqf=titlemm=100%25stopwords=truelowercaseOperators=true
 

 rawquerystring: +(word1 word2), querystring: +(word1 word2),
 parsedquery: (+(+(DisjunctionMaxQuery((title:word1))
 DisjunctionMaxQuery((title:word2)/no_coord,
 parsedquery_toString: +(+((title:word1) (title:word2))),

 There are any changes on two queries

 solr version 4.8.1

 Thanks,
 Mahmoud

 On Thu, Apr 2, 2015 at 6:56 PM, Davis, Daniel (NIH/NLM) [C] 
 daniel.da...@nih.gov wrote:

  Thanks Shawn,
 
  This is what I thought, but Solr often has features I don't anticipate.
 
  -Original Message-
  From: Shawn Heisey [mailto:apa...@elyograg.org]
  Sent: Thursday, April 02, 2015 12:54 PM
  To: solr-user@lucene.apache.org
  Subject: Re: edismax operators
 
  On 4/2/2015 9:59 AM, Davis, Daniel (NIH/NLM) [C] wrote:
   Can the mm parameter be set per clause?I guess I've ignored it in
  the past aside from setting it once to what seemed like a reasonable
 value.
   That is probably replicated across every collection, which cannot be
  ideal for relevance.
 
  It applies to the whole query.  You can have a different value on every
  query you send.  Just like with other parameters, defaults can be
  configured in the solrconfig.xml request handler definition.
 
  Thanks,
  Shawn