Package org.appng.search
Interface SearchProvider
-
- All Known Implementing Classes:
StandardSearcher
public interface SearchProvider
When performing a global search within aSite
, everyApplication
of the site is checked forSearchProvider
s offering someDocument
s.- Author:
- Matthias Müller
- See Also:
Document
,FeatureProvider.getIndexer()
,DocumentProvider
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_HITS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Iterable<Document>
doSearch(Environment env, Site site, Application application, org.apache.lucene.store.Directory directory, String term, String language, String[] parseFields, org.apache.lucene.analysis.Analyzer analyzer, String highlightWith, Map<String,String> parameters)
Performs the actual search
-
-
-
Field Detail
-
MAX_HITS
static final int MAX_HITS
- See Also:
- Constant Field Values
-
-
Method Detail
-
doSearch
Iterable<Document> doSearch(Environment env, Site site, Application application, org.apache.lucene.store.Directory directory, String term, String language, String[] parseFields, org.apache.lucene.analysis.Analyzer analyzer, String highlightWith, Map<String,String> parameters) throws IOException
Performs the actual search- Parameters:
env
- the currentEnvironment
site
- the currentSite
application
- the currentApplication
directory
- theDirectory
representing the currentSite
's Lucene index.
Note that it only makes sense to use this directory for searching if theApplication
also contributes someDocument
s to theSite
's global index by usingFeatureProvider.getIndexer()
or implementingDocumentProvider
. Otherwise, theApplication
might have it's own Lucene index or even get theDocument
s from somewhere else (for example from the database or filesystem).term
- the search termlanguage
- the language for the searchparseFields
- the fields to searchanalyzer
- theAnalyzer
to usehighlightWith
- a tagname to highlight fragments with, e.gspan
ordiv
parameters
- some custom parameters for this search- Returns:
- an
Iterable
<Document
> containing the foundDocument
s - Throws:
IOException
- if an error occurs while searching
-
-