lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <>
Subject Re: Store a query in a database for later use
Date Thu, 17 May 2012 21:13:14 GMT
On Fri, May 18, 2012 at 6:23 AM, Jamie Johnson <> 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?)


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

View raw message