org.mycore.frontend.indexbrowser.lucene
Class MCRIndexBrowserSearcher

java.lang.Object
  extended by org.mycore.frontend.indexbrowser.lucene.MCRIndexBrowserSearcher

public class MCRIndexBrowserSearcher
extends Object

Searcher class for the index browser. Creates a list of MCRIndexBrowserEntries which contains the results of the search.

This class is excluded from MCRIndexBrowserData.

Author:
Matthias Eichner

Field Summary
protected  MCRIndexBrowserIncomingData browseData
           
protected  List<MCRIndexBrowserEntry> hitList
           
protected  MCRIndexBrowserConfig indexConfig
           
protected static Logger LOGGER
           
protected  MCRQuery query
           
protected  MCRResults results
           
 
Constructor Summary
MCRIndexBrowserSearcher(MCRIndexBrowserIncomingData browseData, MCRIndexBrowserConfig indexConfig)
           
 
Method Summary
protected  MCRCondition buildCondition()
          Create the condition of the query.
protected  MCRQuery buildQuery()
          Creates the search query for a new index browser request.
protected  List<MCRSortBy> buildSortCriteria()
          Creates the sort criteria of the query.
protected  List<MCRIndexBrowserEntry> createLinkedListfromSearch()
          Creates a list of MCRIndexBrowserEntries from the results of the search.
 List<MCRIndexBrowserEntry> doSearch()
          Starts the search and returns the result list.
protected  String getOperator()
          Returns the lucene search operator as String to be used doing a lucene query.
 List<MCRIndexBrowserEntry> getResultList()
          Returns the final created result list of the cache.
protected  MCRResults search()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static Logger LOGGER

browseData

protected MCRIndexBrowserIncomingData browseData

indexConfig

protected MCRIndexBrowserConfig indexConfig

query

protected MCRQuery query

results

protected MCRResults results

hitList

protected List<MCRIndexBrowserEntry> hitList
Constructor Detail

MCRIndexBrowserSearcher

public MCRIndexBrowserSearcher(MCRIndexBrowserIncomingData browseData,
                               MCRIndexBrowserConfig indexConfig)
Method Detail

doSearch

public List<MCRIndexBrowserEntry> doSearch()
Starts the search and returns the result list.

Returns:
the result list

buildQuery

protected MCRQuery buildQuery()
Creates the search query for a new index browser request. The result of this query will be cached.

Returns:
a new MCRQuery.

buildCondition

protected MCRCondition buildCondition()
Create the condition of the query.

Returns:
a new condition.

buildSortCriteria

protected List<MCRSortBy> buildSortCriteria()
Creates the sort criteria of the query.

Returns:
a new list of sort criteria.

search

protected MCRResults search()

createLinkedListfromSearch

protected List<MCRIndexBrowserEntry> createLinkedListfromSearch()
Creates a list of MCRIndexBrowserEntries from the results of the search. Each entry has gets the id and the sort values of the mcr hit object.

Returns:
a new list of MCRIndexBrowserEntries

getOperator

protected String getOperator()
Returns the lucene search operator as String to be used doing a lucene query. This will be taken from MyBrowseData.mode; If MyBrowseData.mode == "prefix" -> return "like", If MyBrowseData.mode == "equals" -> return "=", Else return "like"

Returns:
The lucene search operator as String

getResultList

public List<MCRIndexBrowserEntry> getResultList()
Returns the final created result list of the cache.

Returns:
a list of MCRIndexBrowserEntries