Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: General
Re: How to Use separte Analyzer for indexing and Query Parsing
 

Index | Next | Previous | View Flat


simon.willnauer at googlemail

Dec 5, 2011, 12:05 PM


Views: 319
Permalink
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 [at] gmail> 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.

Subject User Time
How to Use separte Analyzer for indexing and Query Parsing parnab.2007 at gmail Dec 3, 2011, 2:57 AM
    How to Use separte Analyzer for indexing and Query Parsing parnab.2007 at gmail Dec 3, 2011, 3:01 AM
        Re: How to Use separte Analyzer for indexing and Query Parsing simon.willnauer at googlemail Dec 5, 2011, 12:05 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.