eu.etaxonomy.cdm.search
Class LuceneSearch
java.lang.Object
eu.etaxonomy.cdm.search.LuceneSearch
public class LuceneSearch
- extends Object
- Author:
- Andreas Kohlbecker
|
Field Summary |
static Logger |
logger
|
int |
MAX_HITS_ALLOWED
The MAX_HITS_ALLOWED value must be one less than Integer.MAX_VALUE
otherwise PriorityQueue will produce an exception since it
will always add 1 to the maxhits so Integer.MAX_VALUE
would become Integer.MIN_VALUE |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
public static final Logger logger
MAX_HITS_ALLOWED
public final int MAX_HITS_ALLOWED
- The MAX_HITS_ALLOWED value must be one less than Integer.MAX_VALUE
otherwise PriorityQueue will produce an exception since it
will always add 1 to the maxhits so Integer.MAX_VALUE
would become Integer.MIN_VALUE
- See Also:
- Constant Field Values
LuceneSearch
public LuceneSearch(org.hibernate.Session session,
Class<? extends CdmBase> type)
- Parameters:
session -
getSearcher
public org.apache.lucene.search.Searcher getSearcher()
- Returns:
executeSearch
public org.apache.lucene.search.TopDocs executeSearch(String luceneQueryString,
Class<? extends CdmBase> clazz,
Integer pageSize,
Integer pageNumber)
throws org.apache.lucene.queryParser.ParseException,
IOException
- Parameters:
luceneQueryString - clazz - the type as additional filter criterionpageSize - if the page size is null or in an invalid range it will be set to MAX_HITS_ALLOWEDpageNumber - a 0-based index of the page to return, will default to 0 if null or negative.
- Returns:
-
- Throws:
org.apache.lucene.queryParser.ParseException
IOException
executeSearch
public org.apache.lucene.search.TopDocs executeSearch(org.apache.lucene.search.Query luceneQuery,
Class<? extends CdmBase> clazz,
Integer pageSize,
Integer pageNumber)
throws org.apache.lucene.queryParser.ParseException,
IOException
- Parameters:
luceneQuery - clazz - the type as additional filter criterionpageSize - if the page size is null or in an invalid range it will be set to MAX_HITS_ALLOWEDpageNumber - a 0-based index of the page to return, will default to 0 if null or negative.
- Returns:
-
- Throws:
org.apache.lucene.queryParser.ParseException
IOException
Copyright © 2007-2012 EDIT. All Rights Reserved.