org.carrot2.source.lucene
Interface IFieldMapper

All Known Implementing Classes:
SimpleFieldMapper

public interface IFieldMapper

Maps Lucene index's fields onto Carrot2 Document fields. You can provide your own field mapper to LuceneDocumentSource using the LuceneDocumentSource.fieldMapper attribute.


Method Summary
 String[] getSearchFields()
          Return the names of search fields in the index.
 void map(org.apache.lucene.search.Query luceneQuery, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.document.Document luceneDoc, Document doc)
          Map Lucene index's fields onto Carrot2 Document instance.
 

Method Detail

getSearchFields

String[] getSearchFields()
Return the names of search fields in the index.


map

void map(org.apache.lucene.search.Query luceneQuery,
         org.apache.lucene.analysis.Analyzer analyzer,
         org.apache.lucene.document.Document luceneDoc,
         Document doc)
Map Lucene index's fields onto Carrot2 Document instance. It is sensible to map at least Document.CONTENT_URL, Document.TITLE and Document.SUMMARY.

Parameters:
luceneQuery - Query used to fetch Lucene document from the index. It is advised to cache any query-related data internally and if this parameter does not change, reuse that data.
analyzer - Analyzer used for creating the index.
luceneDoc - Lucene hit.
doc - Target Carrot2 document.


Copyright (c) Dawid Weiss, Stanislaw Osinski