org.sourceforge.beanindex.search
Class BeanIndexSearcher

java.lang.Object
  extended byorg.sourceforge.beanindex.search.BeanIndexSearcher

public class BeanIndexSearcher
extends java.lang.Object

Author:
Sakthivel Muthusamy

Constructor Summary
BeanIndexSearcher(java.lang.String path, java.lang.String defLglOp, SearcherConfigInfo searcherConfig)
           
 
Method Summary
 void close()
           
 Query createSearchRequest()
          creates a Query.If the deployment is in progress then the method waits until deployment is comlete
 int[] execPostFixEngine(Token[] tokens)
           
 java.lang.Object[] get(int[] ids, long clientTimeStamp)
           
 IndexField[] getAllIndexedFields()
           
 Index[] getAllIndexViews()
           
 long getTimeStamp()
           
 void init(java.lang.String path, java.lang.String defLglOp, SearcherConfigInfo searcherConfig)
          This method is called after doing a redeploy to bring the index searcher to service
 boolean isDeploymentInProgress()
           
 Token[] parse(java.lang.String phrase)
           
 void prepareHotDeploy()
          This method closes the files opened for searching to enable the redeploy
 Token[] readInvxIndexData(java.lang.String indexName, Token[] tokens)
           
 java.lang.String[] resolveWildCardSearchTerm(java.lang.String term)
           
 Hits search(Query request)
           
 Token[] searchDictionary(Token[] tokens)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanIndexSearcher

public BeanIndexSearcher(java.lang.String path,
                         java.lang.String defLglOp,
                         SearcherConfigInfo searcherConfig)
                  throws java.lang.Exception
Parameters:
path -
defLglOp -
searcherConfig -
Throws:
java.lang.Exception
Method Detail

get

public java.lang.Object[] get(int[] ids,
                              long clientTimeStamp)
                       throws StaleObjectException,
                              BeanIndexException
Parameters:
ids -
clientTimeStamp -
Returns:
Object[]
Throws:
StaleObjectException
BeanIndexException

createSearchRequest

public Query createSearchRequest()
creates a Query.If the deployment is in progress then the method waits until deployment is comlete

Returns:
Query

getAllIndexViews

public Index[] getAllIndexViews()
Returns:
Index[]

getAllIndexedFields

public IndexField[] getAllIndexedFields()
Returns:
IndexField[]

search

public Hits search(Query request)
            throws java.lang.Exception
Parameters:
request -
Returns:
Hits
Throws:
java.lang.Exception

init

public void init(java.lang.String path,
                 java.lang.String defLglOp,
                 SearcherConfigInfo searcherConfig)
          throws java.lang.Exception
This method is called after doing a redeploy to bring the index searcher to service

Parameters:
path -
Throws:
java.lang.Exception

prepareHotDeploy

public void prepareHotDeploy()
                      throws java.lang.Exception
This method closes the files opened for searching to enable the redeploy

Throws:
java.lang.Exception

close

public void close()
           throws java.lang.Exception
Throws:
java.lang.Exception

execPostFixEngine

public int[] execPostFixEngine(Token[] tokens)
Parameters:
tokens -
Returns:
int[]

readInvxIndexData

public Token[] readInvxIndexData(java.lang.String indexName,
                                 Token[] tokens)
                          throws java.lang.Exception
Parameters:
indexName -
tokens -
Returns:
Token[]
Throws:
java.lang.Exception

searchDictionary

public Token[] searchDictionary(Token[] tokens)
                         throws java.lang.Exception
Parameters:
tokens -
Returns:
Token[]
Throws:
java.lang.Exception

parse

public Token[] parse(java.lang.String phrase)
              throws BeanIndexException
Parameters:
phrase -
Returns:
Token[]
Throws:
BeanIndexException

getTimeStamp

public long getTimeStamp()
Returns:
long

resolveWildCardSearchTerm

public java.lang.String[] resolveWildCardSearchTerm(java.lang.String term)
                                             throws java.lang.Exception
Parameters:
term -
Returns:
String[]
Throws:
java.lang.Exception

isDeploymentInProgress

public boolean isDeploymentInProgress()
Returns:
boolean