lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Xinlei Wang <stanl...@csail.mit.edu>
Subject Re: Question: Using Shingle Analyzer NGramAnalyzerWrapper in Lucene
Date Tue, 26 Feb 2008 20:39:13 GMT
Sorry slight correction for the code below: I was actually using the 
WhitespaceAnalyzer, not the StandardAnalyzer in constructing the 
NGramAnalyzerWrapper.

On Tue, 26 Feb 2008, Stanley Xinlei Wang wrote:

> Hi,
>
> In Lucene, I'm trying to perform word-level bi-gram query parsing using 
> NGramAnalyzerWrapper.  I'm couldn't get any word pairs in the parsed query 
> and I was wondering what I should do to make this work.  I'm using Lucene 
> 2.2.0
>
> I'm using the files from: https://issues.apache.org/jira/browse/lucene-400
>
> My code is:
>
> NGramAnalyzerWrapper analyzer = new NGramAnalyzerWrapper(new
> 	StandardAnalyzer(), 2);
> QueryParser p = new QueryParser("info", analyzer);
> Query query = lyricsParser.parse("this is my query");
> System.out.println(query.toString());
>
> When I run this, I get the following output, which has no bi-grams:
>
> lyrics:this lyrics:is lyrics:a lyrics:query
>
>
> Thank you for your help!
>
> Stanley
>

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