xml query parser for 4.0 alpha?

326 views
Skip to first unread message

mitzimorris

unread,
Jul 24, 2012, 4:27:53 PM7/24/12
to luke-d...@googlegroups.com
The XML query parser isn't working for 4.0 alpha -
here's the beginning of the stack trace:

java.lang.NoClassDefFoundError: org/apache/lucene/sandbox/queries/DuplicateFilter
    at org.apache.lucene.queryparser.xml.CorePlusExtensionsParser.<init>(CorePlusExtensionsParser.java:54)
    at org.apache.lucene.queryparser.xml.CorePlusExtensionsParser.<init>(CorePlusExtensionsParser.java:47)
    at org.getopt.luke.xmlQuery.CorePlusExtensionsParserFactory.createParser(CorePlusExtensionsParserFactory.java:11)


The XML query parser works great in Luke 3.5!
in answer to a long-ago question, the XML Query syntax is documented only in the Lucene Core src distribution.
for 3.6 the path to these docs is:
lucene-3.6.0/contrib/xml-query-parser/docs/LuceneCoreQuery.dtd.html
works on my machine!
cheers,
Mitzi


MarkH

unread,
Jul 26, 2012, 4:35:08 AM7/26/12
to luke-d...@googlegroups.com
The CorePlusExtensionsParser refers to the DuplicateFilter class that currently does not work with the new Lucene APIs (filters are now segment-level rather than global and detecting duplicates requires global visibility).
Consequently DuplicateFilter has been moved into the "sandbox" and should not really be used unless you have a single-segment index.


You can succesfully start Luke with the XMLQueryParser if you include this new sandbox dependency on startup ie.
    java -cp lukeall-4.0.0-ALPHA.jar;lucene-sandbox-4.0.0-ALPHA.jar org.getopt.luke.Luke


>> the XML Query syntax is documented only in the Lucene Core src distribution

Ideally the docs should be part of the binary distribution but HTML docs are produced from the DTDs by the DTDDoc tool which would drag in all sorts of dependencies to the build process.
I've often thought that the DTDs and related docs could make a really nice auto-complete type tool in Luke where at any point during query construction Luke can guide as to what legal child queries/filters are available according to the DTD.
An XSL template could also be used to generate a query GUI with dropdown boxes etc rather than editing raw XML. Cool, no?

Cheers,
Mark
Reply all
Reply to author
Forward
0 new messages