Mark, Thanks for responding and the tip about java-user.
So should I be able to do something like Queryparser.parse(q.ToString())? 
//Query q

 


----- Original Message ----
From: Mark Miller <[email protected]>
To: [email protected]
Sent: Wed, February 17, 2010 10:33:04 AM
Subject: Re: query about Query.ToString()

Aaron Schon wrote:
> Hi all, I know that persisting a Lucene query by query ToString() method. Is 
> there any way of reconstructing the query from the string itself?
> The usecase is that I will be storing a library of queries as strings and 
> load the appropriate query (from the string) based on some conditions.
>
> Is this possible?
>
>
>      
>  
For some queries its possible - the docs for Query say impls should
attempt to be parsable by the QueryParser - but in practice it's not
always the case. So you can't reallly count on it across the board.

By the way, these questions are best sent to java-user rather than general.

-- 
- Mark

http://www.lucidimagination.com



Reply via email to