Re: default query operator ignored by edismax query parser
Thanks Shawn! In this case I will use operators everywhere. Johannes Am 25.06.2014 15:09, schrieb Shawn Heisey: On 6/25/2014 1:05 AM, Johannes Siegert wrote: I have defined the following edismax query parser: 100%edismax0.01100*:*ANDfield1^2.0 field210* My search query looks like: q=(word1 word2) OR (word3 word4) Since I specified AND as default query operator, the query should match documents by ((word1 AND word2) OR (word3 AND word4)) but the query matches documents by ((word1 OR word2) OR (word3 OR word4)). Could anyone explain the behaviour? I believe that you are running into this bug: https://issues.apache.org/jira/browse/SOLR-2649 It's a very old bug, coming up on three years. The workaround is to not use boolean operators at all, or to use operators EVERYWHERE so that your intent is explicitly described. It is not much of a workaround, but it does work. Thanks, Shawn
Re: default query operator ignored by edismax query parser
On 6/25/2014 1:05 AM, Johannes Siegert wrote: > I have defined the following edismax query parser: > > name="defaults">100% name="defType">edismax0.01 name="ps">100*:* name="q.op">ANDfield1^2.0 field2 name="rows">10* > > > > My search query looks like: > > q=(word1 word2) OR (word3 word4) > > Since I specified AND as default query operator, the query should match > documents by ((word1 AND word2) OR (word3 AND word4)) but the query > matches documents by ((word1 OR word2) OR (word3 OR word4)). > > Could anyone explain the behaviour? I believe that you are running into this bug: https://issues.apache.org/jira/browse/SOLR-2649 It's a very old bug, coming up on three years. The workaround is to not use boolean operators at all, or to use operators EVERYWHERE so that your intent is explicitly described. It is not much of a workaround, but it does work. Thanks, Shawn
default query operator ignored by edismax query parser
Hi, I have defined the following edismax query parser: name="defaults">100%name="defType">edismax0.01name="ps">100*:*name="q.op">ANDfield1^2.0 field2name="rows">10* My search query looks like: q=(word1 word2) OR (word3 word4) Since I specified AND as default query operator, the query should match documents by ((word1 AND word2) OR (word3 AND word4)) but the query matches documents by ((word1 OR word2) OR (word3 OR word4)). Could anyone explain the behaviour? Thanks! Johannes P.S. The query q=(word1 word2) match all documents by (word1 AND word2)
Re: Default query operator "OR" wont work in some cases
Yeah, sorry, I read the parsed query too quickly - the phrase is the optional relevancy boost due to the pf2 parameter. -- Jack Krupansky -Original Message- From: smanad Sent: Monday, August 26, 2013 10:08 PM To: solr-user@lucene.apache.org Subject: Re: Default query operator "OR" wont work in some cases I am not searching for phrase query, I am not sure why it shows up in parsedquery. 0 3 true true egg salad 1377569284170 xml -- View this message in context: http://lucene.472066.n3.nabble.com/Default-query-operator-OR-wont-work-in-some-cases-tp4086624p4086732.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Default query operator "OR" wont work in some cases
I am not searching for phrase query, I am not sure why it shows up in parsedquery. 0 3 true true egg salad 1377569284170 xml -- View this message in context: http://lucene.472066.n3.nabble.com/Default-query-operator-OR-wont-work-in-some-cases-tp4086624p4086732.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Default query operator "OR" wont work in some cases
The phrase "egg salad" does not occur in your input. And, quoted phrases are an implicit "AND", not an "OR". Either you wanted "egg" and "salad" but not as a phrase, or as a very loose sloppy phrase, such as "egg salad"~10. Or, who knows what you really want - your requirements are expressed too imprecisely. -- Jack Krupansky -Original Message- From: smanad Sent: Monday, August 26, 2013 8:50 PM To: solr-user@lucene.apache.org Subject: Re: Default query operator "OR" wont work in some cases here is keywords field for 3 docs, "Simply Asia products,Simply Asia,Sesame Chicken Egg Drop Soup,Soy Ginger Shrimp and Noodle Salad,Sesame Teriyaki Noodle Bowl" "Eggs,AllWhites,Better'n Eggs,Foods,AllWhites or Better'n Eggs" "DOLE Salad Blend Salad Kit,Salad Kit,Salad,DOLE,produce" Here is my debug query: (+((DisjunctionMaxQuery((keywords:egg^2.0)~0.1) DisjunctionMaxQuery((keywords:salad^2.0)~0.1))~2) DisjunctionMaxQuery((keywords:"egg salad")~0.1) /no_coord Here is my fieldtype definition for keywords, -- View this message in context: http://lucene.472066.n3.nabble.com/Default-query-operator-OR-wont-work-in-some-cases-tp4086624p4086723.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Default query operator "OR" wont work in some cases
here is keywords field for 3 docs, "Simply Asia products,Simply Asia,Sesame Chicken Egg Drop Soup,Soy Ginger Shrimp and Noodle Salad,Sesame Teriyaki Noodle Bowl" "Eggs,AllWhites,Better'n Eggs,Foods,AllWhites or Better'n Eggs" "DOLE Salad Blend Salad Kit,Salad Kit,Salad,DOLE,produce" Here is my debug query: (+((DisjunctionMaxQuery((keywords:egg^2.0)~0.1) DisjunctionMaxQuery((keywords:salad^2.0)~0.1))~2) DisjunctionMaxQuery((keywords:"egg salad")~0.1) /no_coord Here is my fieldtype definition for keywords, -- View this message in context: http://lucene.472066.n3.nabble.com/Default-query-operator-OR-wont-work-in-some-cases-tp4086624p4086723.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Default query operator "OR" wont work in some cases
Try adding &debug=query to your URL, that'll show you how the parsing actually happened and should give you some pointers. Best, Erick On Mon, Aug 26, 2013 at 9:55 AM, smanad wrote: > Hi, > > I have some documents with keywords "egg" and some with "salad" and some > with "egg salad". > When I search for egg salad, I expect to see egg results + salad results. I > dont see them. > egg and salad queries individually work fine. > I am using whitespacetokenizer. > > Not sure if I am missing something. > Thanks, > -Manasi > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Default-query-operator-OR-wont-work-in-some-cases-tp4086624.html > Sent from the Solr - User mailing list archive at Nabble.com. >
Default query operator "OR" wont work in some cases
Hi, I have some documents with keywords "egg" and some with "salad" and some with "egg salad". When I search for egg salad, I expect to see egg results + salad results. I dont see them. egg and salad queries individually work fine. I am using whitespacetokenizer. Not sure if I am missing something. Thanks, -Manasi -- View this message in context: http://lucene.472066.n3.nabble.com/Default-query-operator-OR-wont-work-in-some-cases-tp4086624.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to set default query operator in surround query parser?
Oh. That's bad to me. Thanks anyway. -- View this message in context: http://lucene.472066.n3.nabble.com/How-to-set-default-query-operator-in-surround-query-parser-tp3570034p3570088.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to set default query operator in surround query parser?
> I'm using surround query parser. > The request "A B" returns ParseException. > But "A OR B" returns correct results. > I think this is the problem of default query operator. > Anyone know how to set? There is no room for default operator in surround query parser. This is a limitation of surround.
Re: How to set default query operator in surround query parser?
change the default operator in schema Thanks and Regards, S SYED ABDUL KATHER On Thu, Dec 8, 2011 at 4:44 PM, Jason, Kim [via Lucene] < ml-node+s472066n3570034...@n3.nabble.com> wrote: > Hi, all > > I'm using surround query parser. > The request "A B" returns ParseException. > But "A OR B" returns correct results. > I think this is the problem of default query operator. > Anyone know how to set? > > Thanks, > Jason > > -- > If you reply to this email, your message will be added to the discussion > below: > > http://lucene.472066.n3.nabble.com/How-to-set-default-query-operator-in-surround-query-parser-tp3570034p3570034.html > To unsubscribe from Lucene, click > here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=472066&code=aW4uYWJkdWxAZ21haWwuY29tfDQ3MjA2NnwxMDczOTUyNDEw> > . > NAML<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > - THANKS AND REGARDS, SYED ABDUL KATHER -- View this message in context: http://lucene.472066.n3.nabble.com/How-to-set-default-query-operator-in-surround-query-parser-tp3570034p3570037.html Sent from the Solr - User mailing list archive at Nabble.com.
How to set default query operator in surround query parser?
Hi, all I'm using surround query parser. The request "A B" returns ParseException. But "A OR B" returns correct results. I think this is the problem of default query operator. Anyone know how to set? Thanks, Jason -- View this message in context: http://lucene.472066.n3.nabble.com/How-to-set-default-query-operator-in-surround-query-parser-tp3570034p3570034.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to use AND as opposed to OR as the default query operator.
However, for user entered queries, I suggest you take a look at dismax, a lot more suitable for user-entered queries than the standard solr-lucene query parsers. Markus Jelsma wrote: http://wiki.apache.org/solr/SchemaXml#Default_query_parser_operator On Monday 25 October 2010 15:41:50 Swapnonil Mukherjee wrote: Hi Everybody, I simply want to use AND as the default operator in queries. When a user searches for Jennifer Lopez solr converts this to a Jennifer OR Lopez query. On the other hand I want solr to treat this query as Jennifer AND Lopez and not as Jennifer OR Lopez. In other words I want a default AND behavior in phrase queries instead of OR. I have seen in this presentation http://www.slideshare.net/pittaya/using-apache-solr on Slide number 52 that this OR behavior is configurable. Could you please tell me where this configuration is located? I could not locate it in schema.xml. Swapnonil Mukherjee +91-40092712 +91-9007131999
Re: How to use AND as opposed to OR as the default query operator.
Hi Pradeep, I am using the standard query parser. I made the changes in schema.xml and it works. It is also good to know that this can done on a per query basis as well. Swapnonil Mukherjee On 25-Oct-2010, at 7:48 PM, Pradeep Singh wrote: > Which query handler are you using? For a standard query handler you can set > q.op per request or set defaultOperator in schema.xml. > > For a dismax handler you will have to work with min should match. > > On Mon, Oct 25, 2010 at 6:41 AM, Swapnonil Mukherjee < > swapnonil.mukher...@gettyimages.com> wrote: > >> Hi Everybody, >> >> I simply want to use AND as the default operator in queries. When a user >> searches for Jennifer Lopez solr converts this to a Jennifer OR Lopez query. >> On the other hand I want solr to treat this query as Jennifer AND Lopez and >> not as Jennifer OR Lopez. >> >> In other words I want a default AND behavior in phrase queries instead of >> OR. >> >> I have seen in this presentation >> http://www.slideshare.net/pittaya/using-apache-solr on Slide number 52 >> that this OR behavior is configurable. >> >> Could you please tell me where this configuration is located? I could not >> locate it in schema.xml. >> >> Swapnonil Mukherjee >> +91-40092712 >> +91-9007131999 >> >> >> >>
Re: How to use AND as opposed to OR as the default query operator.
Which query handler are you using? For a standard query handler you can set q.op per request or set defaultOperator in schema.xml. For a dismax handler you will have to work with min should match. On Mon, Oct 25, 2010 at 6:41 AM, Swapnonil Mukherjee < swapnonil.mukher...@gettyimages.com> wrote: > Hi Everybody, > > I simply want to use AND as the default operator in queries. When a user > searches for Jennifer Lopez solr converts this to a Jennifer OR Lopez query. > On the other hand I want solr to treat this query as Jennifer AND Lopez and > not as Jennifer OR Lopez. > > In other words I want a default AND behavior in phrase queries instead of > OR. > > I have seen in this presentation > http://www.slideshare.net/pittaya/using-apache-solr on Slide number 52 > that this OR behavior is configurable. > > Could you please tell me where this configuration is located? I could not > locate it in schema.xml. > > Swapnonil Mukherjee > +91-40092712 > +91-9007131999 > > > >
Re: How to use AND as opposed to OR as the default query operator.
http://wiki.apache.org/solr/SchemaXml#Default_query_parser_operator On Monday 25 October 2010 15:41:50 Swapnonil Mukherjee wrote: > Hi Everybody, > > I simply want to use AND as the default operator in queries. When a user > searches for Jennifer Lopez solr converts this to a Jennifer OR Lopez > query. On the other hand I want solr to treat this query as Jennifer AND > Lopez and not as Jennifer OR Lopez. > > In other words I want a default AND behavior in phrase queries instead of > OR. > > I have seen in this presentation > http://www.slideshare.net/pittaya/using-apache-solr on Slide number 52 > that this OR behavior is configurable. > > Could you please tell me where this configuration is located? I could not > locate it in schema.xml. > > Swapnonil Mukherjee > +91-40092712 > +91-9007131999 -- Markus Jelsma - CTO - Openindex http://www.linkedin.com/in/markus17 050-8536600 / 06-50258350
How to use AND as opposed to OR as the default query operator.
Hi Everybody, I simply want to use AND as the default operator in queries. When a user searches for Jennifer Lopez solr converts this to a Jennifer OR Lopez query. On the other hand I want solr to treat this query as Jennifer AND Lopez and not as Jennifer OR Lopez. In other words I want a default AND behavior in phrase queries instead of OR. I have seen in this presentation http://www.slideshare.net/pittaya/using-apache-solr on Slide number 52 that this OR behavior is configurable. Could you please tell me where this configuration is located? I could not locate it in schema.xml. Swapnonil Mukherjee +91-40092712 +91-9007131999
Re: Default Query Operator
Hi, I already have done this but still I am not getting any record. But if I remove the qt=dismaxrequest, then it works fine. Erik Hatcher wrote: > > With dismax, to get all terms required, set mm (minimum match) to 100% > > Erik > > On May 11, 2009, at 4:08 AM, dabboo wrote: > >> >> Sorry to mention in the problem that I am trying to do this with >> dismax >> request. Without dismax request, it is working fine but not with >> dismax >> request. >> >> >> Avlesh Singh wrote: >>> >>> Having in your schema.xml >>> should >>> address your requirements. >>> >>> Cheers >>> Avlesh >>> >>> On Mon, May 11, 2009 at 12:18 PM, dabboo wrote: >>> >>>> >>>> Hi, >>>> >>>> Presently "OR" is the default operator for search in Solr. for >>>> e.g. If I >>>> am >>>> searching for these 2 words with a space: abc xyz then it will >>>> return all >>>> the records which has either abc or xyz or both. It means it is >>>> executing >>>> query like abc or xyz. >>>> >>>> But my requirement is that it should return only those records which >>>> contains abc and xyz both i.e. It should execute the query using AND >>>> operator as default like abc and xyz. >>>> >>>> Please suggest how I can do this. >>>> >>>> Thanks, >>>> Amit Garg >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/Default-Query-Operator- >>>> tp23477955p23477955.html >>>> Sent from the Solr - User mailing list archive at Nabble.com. >>>> >>>> >>> >>> >> >> -- >> View this message in context: >> http://www.nabble.com/Default-Query-Operator-tp23477955p23478820.html >> Sent from the Solr - User mailing list archive at Nabble.com. > > > -- View this message in context: http://www.nabble.com/Default-Query-Operator-tp23477955p23485608.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Default Query Operator
With dismax, to get all terms required, set mm (minimum match) to 100% Erik On May 11, 2009, at 4:08 AM, dabboo wrote: Sorry to mention in the problem that I am trying to do this with dismax request. Without dismax request, it is working fine but not with dismax request. Avlesh Singh wrote: Having in your schema.xml should address your requirements. Cheers Avlesh On Mon, May 11, 2009 at 12:18 PM, dabboo wrote: Hi, Presently "OR" is the default operator for search in Solr. for e.g. If I am searching for these 2 words with a space: abc xyz then it will return all the records which has either abc or xyz or both. It means it is executing query like abc or xyz. But my requirement is that it should return only those records which contains abc and xyz both i.e. It should execute the query using AND operator as default like abc and xyz. Please suggest how I can do this. Thanks, Amit Garg -- View this message in context: http://www.nabble.com/Default-Query-Operator- tp23477955p23477955.html Sent from the Solr - User mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Default-Query-Operator-tp23477955p23478820.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Default Query Operator
Sorry to mention in the problem that I am trying to do this with dismax request. Without dismax request, it is working fine but not with dismax request. Avlesh Singh wrote: > > Having in your schema.xml should > address your requirements. > > Cheers > Avlesh > > On Mon, May 11, 2009 at 12:18 PM, dabboo wrote: > >> >> Hi, >> >> Presently "OR" is the default operator for search in Solr. for e.g. If I >> am >> searching for these 2 words with a space: abc xyz then it will return all >> the records which has either abc or xyz or both. It means it is executing >> query like abc or xyz. >> >> But my requirement is that it should return only those records which >> contains abc and xyz both i.e. It should execute the query using AND >> operator as default like abc and xyz. >> >> Please suggest how I can do this. >> >> Thanks, >> Amit Garg >> -- >> View this message in context: >> http://www.nabble.com/Default-Query-Operator-tp23477955p23477955.html >> Sent from the Solr - User mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Default-Query-Operator-tp23477955p23478820.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Default Query Operator
Having in your schema.xml should address your requirements. Cheers Avlesh On Mon, May 11, 2009 at 12:18 PM, dabboo wrote: > > Hi, > > Presently "OR" is the default operator for search in Solr. for e.g. If I am > searching for these 2 words with a space: abc xyz then it will return all > the records which has either abc or xyz or both. It means it is executing > query like abc or xyz. > > But my requirement is that it should return only those records which > contains abc and xyz both i.e. It should execute the query using AND > operator as default like abc and xyz. > > Please suggest how I can do this. > > Thanks, > Amit Garg > -- > View this message in context: > http://www.nabble.com/Default-Query-Operator-tp23477955p23477955.html > Sent from the Solr - User mailing list archive at Nabble.com. > >
Default Query Operator
Hi, Presently "OR" is the default operator for search in Solr. for e.g. If I am searching for these 2 words with a space: abc xyz then it will return all the records which has either abc or xyz or both. It means it is executing query like abc or xyz. But my requirement is that it should return only those records which contains abc and xyz both i.e. It should execute the query using AND operator as default like abc and xyz. Please suggest how I can do this. Thanks, Amit Garg -- View this message in context: http://www.nabble.com/Default-Query-Operator-tp23477955p23477955.html Sent from the Solr - User mailing list archive at Nabble.com.