lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <simon.willna...@googlemail.com>
Subject Re: How to Use separte Analyzer for indexing and Query Parsing
Date Mon, 05 Dec 2011 20:05:25 GMT
Analyzer indexAnalyzer = ...;
Analyzer queryAnalyzer = ...;

// indexing side
IndexWriter writer = new IndexWriter(version, config, indexAnalyzer);
... add documents

// query side
QueryParser parser = new QueryParser(version, "defaultField", queryAnalyzer);
searcher.search(parser.parse(query), 10);


hope that helps

simon
On Sat, Dec 3, 2011 at 12:01 PM, parnab <parnab.2007@gmail.com> wrote:
> I have two analyzers one suited for indexing and the other suited for query
> parsing.How can i specify indexer to use a specific analyzer and query
> parser to use the other one.
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-Use-separte-Analyzer-for-indexing-and-Query-Parsing-tp3556878p3556878.html
> Sent from the Lucene - General mailing list archive at Nabble.com.

Mime
View raw message