Hi Webster, what does the query debug say? if you set debug=true in the request you can have a better idea about how the two queries get interpreted
Andrea On Mon, 15 Jun 2020 at 16:01, Webster Homer < webster.ho...@milliporesigma.com> wrote: > Markus, > Thanks, for the reference, but that doesn't answer my question. If - is a > special character, it's not consistently special. In my example > "3-DIMETHYL" behaves quite differently than ")-PYRIMIDINE". If I escape > the closing parenthesis the following minus no longer behaves specially. > The referred article does not even mention parenthesis, but it changes the > behavior of the following "-" if it is escaped. In "3-DIMETHYL" the minus > is not special. > > These all fix the problem: > 1,3-DIMETHYL-5-(3-PHENYL-ALLYLIDENE\)-PYRIMIDINE-2,4,6-TRIONE > 1,3-DIMETHYL-5-(3-PHENYL-ALLYLIDENE)\-PYRIMIDINE-2,4,6-TRIONE > 1,3-DIMETHYL-5-\(3-PHENYL-ALLYLIDENE\)-PYRIMIDINE-2,4,6-TRIONE > > Only the minus following the parenthesis is treated as a NOT. > Are parentheses special? They're not mentioned in the eDismax > documentation. > > -----Original Message----- > From: Markus Jelsma <markus.jel...@openindex.io> > Sent: Saturday, June 13, 2020 4:57 AM > To: solr-user@lucene.apache.org > Subject: RE: eDismax query syntax question > > Hello, > > These are special characters, if you don't need them, you must escape them. > > See top of the article: > > https://lucene.apache.org/solr/guide/8_5/the-extended-dismax-query-parser.html > > Markus > > > > > -----Original message----- > > From:Webster Homer <webster.ho...@milliporesigma.com> > > Sent: Friday 12th June 2020 22:09 > > To: solr-user@lucene.apache.org > > Subject: eDismax query syntax question > > > > Recently we found strange behavior in a query. We use eDismax as the > query parser. > > > > This is the query term: > > 1,3-DIMETHYL-5-(3-PHENYL-ALLYLIDENE)-PYRIMIDINE-2,4,6-TRIONE > > > > It should hit one document in our index. It does not. However, if you > use the Dismax query parser it does match the record. > > > > The problem seems to involve the parenthesis and the dashes. If you > > escape the dash after the parenthesis it matches > > 1,3-DIMETHYL-5-(3-PHENYL-ALLYLIDENE)\-PYRIMIDINE-2,4,6-TRIONE > > > > I thought that eDismax and Dismax escaped all lucene special characters > before passing the query to lucene. Although I also remember reading that + > and - can have special significance in a query if preceded with white > space. I can find very little documentation on either query parser in how > they work. > > > > Is this expected behavior or is this a bug? If expected, where can I > find documentation? > > > > > > > > This message and any attachment are confidential and may be privileged > or otherwise protected from disclosure. If you are not the intended > recipient, you must not copy this message or attachment or disclose the > contents to any other person. If you have received this transmission in > error, please notify the sender immediately and delete the message and any > attachment from your system. Merck KGaA, Darmstadt, Germany and any of its > subsidiaries do not accept liability for any omissions or errors in this > message which may arise as a result of E-Mail-transmission or for damages > resulting from any unauthorized changes of the content of this message and > any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its > subsidiaries do not guarantee that this message is free of viruses and does > not accept liability for any damages caused by any virus transmitted > therewith. > > > > > > > > Click http://www.merckgroup.com/disclaimer to access the German, > French, Spanish and Portuguese versions of this disclaimer. > > > > > This message and any attachment are confidential and may be privileged or > otherwise protected from disclosure. If you are not the intended recipient, > you must not copy this message or attachment or disclose the contents to > any other person. If you have received this transmission in error, please > notify the sender immediately and delete the message and any attachment > from your system. Merck KGaA, Darmstadt, Germany and any of its > subsidiaries do not accept liability for any omissions or errors in this > message which may arise as a result of E-Mail-transmission or for damages > resulting from any unauthorized changes of the content of this message and > any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its > subsidiaries do not guarantee that this message is free of viruses and does > not accept liability for any damages caused by any virus transmitted > therewith. > > > > Click http://www.merckgroup.com/disclaimer to access the German, French, > Spanish and Portuguese versions of this disclaimer. > -- Andrea Gazzarini *Search Consultant, R&D Software Engineer* www.sease.io email: a.gazzar...@sease.io cell: +39 349 513 86 25