You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by דנה שגיא <da...@gmail.com> on 2016/11/06 15:29:40 UTC

Complex Query parsing: Query-> String/XML/JSON/other -> Query (java)

Hi,
I have two different processes which run separately (could be different
machines, different times). the first one creates an xml file with relevant
data (strings) which the second process gets as an input (including a
complex lucene query).
Until now, I used Query.toString() to save the Query into the xml file
because the second process only printed the query.
Now I want the second process to use this query and get the TopDocs
according to it.
I read about QueryParser and some tools to create a Query from an input
(String/ xml) but haven't saw a way to serialize the Query in the first
place (toString() didn't work well).

my question is, how can I save an existing Query into a file in the first
process, so the second one could get the query from the file and use it
(for example with QueryParser or any other tool)?
Thanks,
Dana