ccc.api.jaxrs
Class SearchImpl

java.lang.Object
  extended by ccc.api.jaxrs.JaxrsCollection
      extended by ccc.api.jaxrs.SearchImpl
All Implemented Interfaces:
Scheduler, SearchEngine

public class SearchImpl
extends JaxrsCollection
implements SearchEngine

JAX-RS implementation of the SearchEngine interface.

Author:
Civic Computing Ltd.

Field Summary
 
Fields inherited from interface ccc.api.core.SearchEngine
NAME
 
Constructor Summary
SearchImpl(SearchEngine search)
          Constructor.
 
Method Summary
 SearchResult find(java.lang.String searchTerms, int noOfResultsPerPage, int page)
          Find the entities that match the specified search terms.
 SearchResult find(java.lang.String searchTerms, java.lang.String sort, SortOrder order, int resultCount, int page)
          Find the results that match the specified search terms.
 void index()
          Rebuild the search index.
 boolean isRunning()
          Query whether the scheduler is running.
 SearchResult similar(java.lang.String uuid, int noOfResultsPerPage, int page)
          Find the results that are similar to the specified page.
 void start()
          Start the scheduler running.
 void stop()
          Stop the scheduler running.
 
Methods inherited from class ccc.api.jaxrs.JaxrsCollection
convertException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchImpl

public SearchImpl(SearchEngine search)
Constructor.

Parameters:
search - The search implementation delegated too.
Method Detail

find

public SearchResult find(java.lang.String searchTerms,
                         int noOfResultsPerPage,
                         int page)
Find the entities that match the specified search terms.

Specified by:
find in interface SearchEngine
Parameters:
searchTerms - The terms to match.
noOfResultsPerPage - The number of results to return.
page - The page of results to return (first page has index of 0).
Returns:
The SearchResult object with set entities and total count.

index

public void index()
Rebuild the search index.

Specified by:
index in interface SearchEngine

isRunning

public boolean isRunning()
Query whether the scheduler is running.

Specified by:
isRunning in interface Scheduler
Returns:
True if the scheduler is running; false otherwise.

start

public void start()
Start the scheduler running.

Specified by:
start in interface Scheduler

stop

public void stop()
Stop the scheduler running.

Specified by:
stop in interface Scheduler

similar

public SearchResult similar(java.lang.String uuid,
                            int noOfResultsPerPage,
                            int page)
Find the results that are similar to the specified page.

Specified by:
similar in interface SearchEngine
Parameters:
uuid - The page to match.
noOfResultsPerPage - The number of results to return.
page - The page of results to return (first page has index of 0).
Returns:
The SearchResult object with set entities and total count.

find

public SearchResult find(java.lang.String searchTerms,
                         java.lang.String sort,
                         SortOrder order,
                         int resultCount,
                         int page)
Find the results that match the specified search terms.

Specified by:
find in interface SearchEngine
Parameters:
searchTerms - The terms to match.
sort - The field to sort on.
order - The order of the sort.
resultCount - The number of results to return.
page - The page of results to return (first page has index of 0).
Returns:
The SearchResult object with set entities and total count.


Copyright © 2010. All Rights Reserved.