Class SearchEngine

java.lang.Object
org.biopax.paxtools.search.SearchEngine
All Implemented Interfaces:
Indexer, Searcher

public class SearchEngine extends Object implements Indexer, Searcher
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
  • Field Details

  • Constructor Details

    • SearchEngine

      public SearchEngine(Model model, String indexLocation)
      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: Searcher
      Full-text search for BioPAX elements.
      Specified by:
      search in interface Searcher
      Parameters:
      query - String (keywords or Lucene query string)
      page - hits page number (when the number of hits exceeds a threshold)
      filterByType - - class filter
      datasources - - filter by datasource
      organisms - - filter by organism
      Returns:
      a bean that contains the list of BioPAX objects (hits) and annotations.
    • index

      public void index()
      Specified by:
      index in interface Indexer