3 * Copyright (C) 2013 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.api
.service
.search
;
12 import org
.apache
.lucene
.analysis
.Analyzer
;
13 import org
.apache
.lucene
.index
.IndexReader
;
14 import org
.apache
.lucene
.queryParser
.QueryParser
;
15 import org
.hibernate
.search
.indexes
.IndexReaderAccessor
;
17 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
20 * @author a.kohlbecker
24 public interface ILuceneIndexToolProvider
{
27 * @return the IndexReader suitable for the lucene index of the given
30 public abstract IndexReader
getIndexReaderFor(Class
<?
extends CdmBase
> clazz
);
33 * Either creates a new QueryParser or returns the QueryParser which has
34 * been created before for the specified class. The QueryParsers per CdmBase
35 * type are cached in a Map.
37 * @return the QueryParser suitable for the lucene index of the given
40 public abstract QueryParser
getQueryParserFor(Class
<?
extends CdmBase
> clazz
);
43 * <b>WARING</b> The implementation of this method might return an Analyzer
44 * which is not suitable for all fields of the lucene document. This method
45 * internally uses the simplified method from {@link {
46 * @link org.hibernate.search.SearchFactory#getAnalyzer(Class)}
48 * @return the Analyzer suitable for the lucene index of the given
51 public abstract Analyzer
getAnalyzerFor(Class
<?
extends CdmBase
> clazz
);
54 * Creates new QueryFactory for the specified Cdm type.
56 * @return A new QueryFactory suitable for the lucene index of the given
59 public abstract QueryFactory
newQueryFactoryFor(Class
<?
extends CdmBase
> clazz
);
62 * @return the IndexReaderAccessor from the SearchFactory
64 public abstract IndexReaderAccessor
getIndexReaderAccessor();