lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: all stop words in exact phrase get 0 hits
Date Mon, 19 Dec 2005 18:49:48 GMT

On Dec 19, 2005, at 11:30 AM, javier muguruza wrote:

> I have moved from my approach:
> Query query = QueryParser.parse("big lucene expression", "afield",
> LuceneHelper.getAnalyzer());
>
> to building the query based on BooleanQuery, PhareQuery, TermQuery
> etc...But before the analyzer was doing a bunch of work in my incoming
> words, and I dont see an easy way to do the same sort of stuff to the
> incoming  words used in PhareQuery, TermQuery etc.
>
> Isnt there such a  way I miss to see? Any example somewhere (LIA etc)

Look at the AnalyzerDemo code.  There isn't anything built in, as  
doing it only involves a few lines of code.  Run a String (via  
StringReader) through an Analyzer, pluck out the tokens from the  
resultant TokenStream, create the queries you want from those  
tokens.   I use this technique frequently to bypass the  
idiosyncrasies of QueryParser or in places where using the QP syntax  
is undesirable but analysis still needs to occur.

	Erik


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