Package org.biopax.paxtools.search
Class SearchEngine
java.lang.Object
org.biopax.paxtools.search.SearchEngine
A full-text searcher/indexer for BioPAX L3 models.
TODO: upgrade to the latest Lucene API and copy some changes from cPath2 project.
- Author:
- rodche
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA Key for the value in a BioPAX element's annotations map where additional information about corresponding search hit will be stored. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the maximum no.voidindex()search(String query, int page, Class<? extends BioPAXElement> filterByType, String[] datasources, String[] organisms) Full-text search for BioPAX elements.voidsetMaxHitsPerPage(int maxHitsPerPage) Sets the maximum no.
-
Field Details
-
FIELD_URI
- See Also:
-
FIELD_KEYWORD
- See Also:
-
FIELD_NAME
- See Also:
-
FIELD_XREFID
- See Also:
-
FIELD_PATHWAY
- See Also:
-
FIELD_N_PARTICIPANTS
- See Also:
-
FIELD_N_PROCESSES
- See Also:
-
FIELD_N
- See Also:
-
FIELD_ORGANISM
- See Also:
-
FIELD_DATASOURCE
- See Also:
-
FIELD_TYPE
- See Also:
-
DEFAULT_FIELDS
-
DEFAULT_MAX_HITS_PER_PAGE
public static final int DEFAULT_MAX_HITS_PER_PAGE- See Also:
-
-
Constructor Details
-
SearchEngine
Main Constructor.- Parameters:
model- BioPAX object model to be indexed or searched.indexLocation- full path to the index directory
-
-
Method Details
-
setMaxHitsPerPage
public void setMaxHitsPerPage(int maxHitsPerPage) Sets the maximum no. hits per search results page (pagination).- Parameters:
maxHitsPerPage- positive int value; otherwise - unlimited
-
getMaxHitsPerPage
public int getMaxHitsPerPage()Gets the maximum no. hits per search results page (pagination parameter).- Returns:
- int value
-
search
public SearchResult search(String query, int page, Class<? extends BioPAXElement> filterByType, String[] datasources, String[] organisms) Description copied from interface:SearcherFull-text search for BioPAX elements.- Specified by:
searchin interfaceSearcher- Parameters:
query- String (keywords or Lucene query string)page- hits page number (when the number of hits exceeds a threshold)filterByType- - class filterdatasources- - filter by datasourceorganisms- - filter by organism- Returns:
- a bean that contains the list of BioPAX objects (hits) and annotations.
-
index
public void index()
-