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 two-fold:

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 utility.

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
To: java-user@lucene.apache.org
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.


Cheers,

Jim Beale
Lead Developer
Hibu.com

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: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to