Mailing List Archive

How to Use separte Analyzer for indexing and Query Parsing
I have two Analyzers -one is suited for Indexing and the other for Query
parsing.How can i specify indexer to use one 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-tp3556869p3556869.html
Sent from the Lucene - General mailing list archive at Nabble.com.
How to Use separte Analyzer for indexing and Query Parsing [ In reply to ]
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.
Re: How to Use separte Analyzer for indexing and Query Parsing [ In reply to ]
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.