lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierrick Brihaye <pierrick.brih...@free.fr>
Subject Re: Reverting QueryParser ?
Date Thu, 14 Apr 2005 16:44:42 GMT
Hi,

Erik Hatcher a écrit :

> No, this hasn't been done except for the basic Query.toString() output 
> which for the most part is parsable again.
> 
> The question is, what do you do about the analysis process?  It's a 
> one-way transformation - and parsing again may not yield the same query.

We (the SDX developpers) have had quite the same need, i.e. to make a 
QueryParsed String parsable again, more often than most of the cases :-)

In fact, we did half of the job ; I mean... prevent analysis :-)

Look at 
http://savannah.nongnu.org/cgi-bin/viewcvs/sdx/sdx_v2/src/java/fr/gouv/culture/sdx/search/lucene/queryparser/DefaultQueryParser.jj?rev=1.16&content-type=text/vnd.viewcvs-markup

and search for : NO_ANALYSIS

You will see that we need an "UnanalyzedQuery" class which is already 
packaged for Lucene ;-)

http://savannah.nongnu.org/cgi-bin/viewcvs/sdx/sdx_v2/src/java/org/apache/lucene/search/UnanalyzedQuery.java?rev=1.4&content-type=text/vnd.viewcvs-markup

The other half could be done by a method like OriginalQuery(String 
field) that would return this kind of string representation :

field:re_analyze_me (i.e. the original token)

or, the SDX way, modify the existing Query(String field) so that it 
would return this kind of string representation :

field:|alreay_analyzed_no_need_to_reanalyze_me|

What do you think ?

Cheers,

p.b.



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message