First of all, query.toString is not idempotent. You cannot count on feeding the results of query.toString back into query and getting the same thing, so that's out.
Not quite sure what the right solution is though.... Best, Erick On Fri, Jan 24, 2014 at 11:29 AM, Olivier Binda <olivier.bi...@wanadoo.fr> wrote: > Hello. > > I would like to serialize a query into a string (A) and then to unserialize > it back into a query (B) > > I guess that a solution is > A) query.toString() > B) StandardQueryParser().parse(query,"") > > It is suboptimal for me though, because my app already has a custom query > parser (with leadingWildCard = on and default_operator=AND) and i would > rather not have a second one, it complicates things a lot : > mixing queries built with the custom queryparser and query built > programmatically starts smelling wrong > > > I would rather have a method that would take a query and export it to a > string with the options (leadingWildCard = on and default_operator=AND). > Is there such a thing ? > > Olivier > > --------------------------------------------------------------------- > 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