On Fri, May 18, 2012 at 6:23 AM, Jamie Johnson <jej2...@gmail.com> wrote:
> I think you want to have a look at the QueryParser classes.  Not sure
> which you're using to start with but probably the default QueryParser
> should suffice.

There are (at least) two catches though:

1. The semantics of a QueryParser might change over time. For
instance, today you might do "white b*" and it is a normal phrase
query. This could gets saved off and in a later version of Lucene, the
QueryParser is updated to parse it as a wildcard phrase query.

2. toString() doesn't always generate a query that the QueryParser can parse.

Lucene Query objects do implement Serializable though so they can be
serialised into a byte array. I do wonder how safe it is to do it
though (if I serialise one from a really early version is it expected
to serialise back in a much later version or does the Lucene backwards
compatibility policy not cover serialisation?)

TX

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