public class QuickSearcher extends Object
Directory
index and an Analyzer
allow for
searches of particular fields.Constructor and Description |
---|
QuickSearcher(org.apache.lucene.store.Directory index,
org.apache.lucene.analysis.Analyzer analyser)
the index to search and the analyser to use to process queries
|
Modifier and Type | Method and Description |
---|---|
HashMap<String[],Float> |
search(String searchfieldName,
String[] returnFieldName,
String queryStr,
int limit)
Given a search field to search,the name of the field to return results in
and a query string, return search results up to the limit.
|
HashMap<String[],Float> |
searchFiltered(String searchfieldName,
String[] returnFieldName,
String queryStr,
String filterFieldName,
List<String> filterQueries)
Given a list of values for the filterField, this method will return the
scores of a search for the documents which satisfy one of those filter
values.
|
public QuickSearcher(org.apache.lucene.store.Directory index, org.apache.lucene.analysis.Analyzer analyser)
index
- analyser
- public HashMap<String[],Float> search(String searchfieldName, String[] returnFieldName, String queryStr, int limit) throws org.apache.lucene.queryparser.classic.ParseException, IOException
searchfieldName
- returnFieldName
- queryStr
- limit
- org.apache.lucene.queryparser.classic.ParseException
IOException
public HashMap<String[],Float> searchFiltered(String searchfieldName, String[] returnFieldName, String queryStr, String filterFieldName, List<String> filterQueries)
searchfieldName
- = Name of the field to searchreturnFieldName
- = Name of the Field to returnqueryStr
- = String that should be used to searchfilterFieldName
- = Name of field to filter onfilterQueries
- = Values of the filterField. Only documents with one of these values will be returned.search(String, String[], String, int)