lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Schon <aaron_sc...@yahoo.com>
Subject Re: query about Query.ToString()
Date Wed, 17 Feb 2010 15:42:54 GMT
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 <markrmiller@gmail.com>
To: general@lucene.apache.org
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


      

Mime
View raw message