lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sokolov <>
Subject Re: Query serialization/deserialization
Date Sun, 04 Aug 2013 20:55:53 GMT
On 07/28/2013 07:32 PM, Denis Bazhenov wrote:
>> A full JSON query ser/deser would be an especially nice additionto Solr, allowing
direct access to all Lucene Query features even if they haven't been integrated into the higher
level query parsers.
> There is nothing we could do, so we wrote one, in fact :) I'll try to elaborate with
the team on the question of contributing it to OSS.
> On Jul 29, 2013, at 1:54 AM, Jack Krupansky <> wrote:
>> Yeah, it's a shame such a ser/deser feature isn't available in Lucene.
>> My idea is to have a separate module that the Query classes can delegate to for serialization
and deserialization, handling recursion for nested query objects, and then have modules for
XML, JSON, and a pseudo-Java functional notation (maybe closer to JavaScript) for the actual
formatting and parser. And then developers can subclass the module to add any custom Query
classes of their own.
I struggled with this as well, and ended up implementing a parallel 
query class hierarchy for query classes I cared about; they support a 
toXmlNode that generates an xml tree that can then be parsed by the 
Lucene XML query parser.  You can see the code here 

but it would be hard to use outside my project.  A more general solution 
would definitely be welcome.

One challenge of course is the wealth of different query parsers: it 
would be nice to be able to emit classic Lucene query parser queries 
where possible, wouldn't it, in addition to structured output like XML 
and JSON?


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

View raw message