lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <>
Subject Re: QueryParser for DisjunctionMaxQuery, et al.
Date Tue, 23 Jul 2013 14:22:22 GMT
I came up with some human-readable BNF rules for the Solr, dismax, and 
edismax query parsers. They are in my book. In fact they are linked from the 
"Solr Hot Spots" section in the preface.

The main problems with re-parsing from a lucene Query structure are 

1. Terms have been analyzed, and there is no guarantee that term analysis is 
idempotent (repeatable without changing the result.)
2. "Query enrichment" or "query enhancement" may have occurred - additional 
terms and operators added. Reparsing them may result in a second (or even 
nth) level of enrichment/enhancement. IOW, query enrichment/enhancement is 
not guaranteed to to be idempotent.

That said, sure somebody could gin up a re-parser. The question is how 
useful it would be. I suppose if the spec for the reparser was that it was 
literal and with no term analysis or query enrichment/enhancement, it could 
work. The fact that nobody has done it is a  testament to its marginal 

Did you have a specific application in mind?

A more useful utility would be a "partial parser" that only parses without 
analysis or enrichment and generates an abstract syntax tree that 
applications could than access and manipulate and then "regenerate" a true 
source query that doesn't have analysis or enrichment (except as the 
application may explicitly have performed on the tree.)

-- Jack Krupansky

-----Original Message----- 
From: Beale, Jim (US-KOP)
Sent: Tuesday, July 23, 2013 10:07 AM
Subject: QueryParser for DisjunctionMaxQuery, et al.

Hello all,

It seems somewhat odd to me that the Query classes generate strings that the 
QueryParser won't parse. Does anyone have a QueryParser that will parse the 
full range of Lucene query strings?

Failing that, has the BNF been written down somewhere?  I can't seem to find 
it for the full cases.

Thanks for any info/guidance.


Jim Beale
Lead Developer

The information contained in this email message, including any attachments, 
is intended solely for use by the individual or entity named above and may 
be confidential. If the reader of this message is not the intended 
recipient, you are hereby notified that you must not read, use, disclose, 
distribute or copy any part of this communication. If you have received this 
communication in error, please immediately notify me by email and destroy 
the original message, including any attachments. Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail: 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message