com.day.cq.search
Interface SimpleSearch

All Known Implementing Classes:
SimpleSearchImpl

public interface SimpleSearch

Search implements a simple fulltext search with some additions to the search logic and exposes the query result in a scripting friendly object structure. For more complex queries, see Query and the QueryBuilder.

Since:
5.2

Field Summary
static String RELATED_PREFIX
          The prefix for a query searches for similar content.
 
Method Summary
 void addPredicate(Predicate predicate)
          Allows to add custom predicates for the underlying Query.
 String getExcerptPropertyNames()
           
 long getHitsPerPage()
           
 String getQuery()
           
 List<String> getRelatedQueries()
           
 SearchResult getResult()
           
 String getSearchIn()
           
 String getSearchProperties()
           
 long getStart()
           
 Trends getTrends()
           
 void setExcerptPropertyNames(String properties)
           
 void setHitsPerPage(long num)
           
 void setQuery(String query)
          Sets a new fulltext query that will be executed.
 void setSearchIn(String searchIn)
           
 void setSearchProperties(String properties)
           
 void setStart(long start)
          This sets an offset for the actual search results, ie.
 

Field Detail

RELATED_PREFIX

static final String RELATED_PREFIX
The prefix for a query searches for similar content.

See Also:
Constant Field Values
Method Detail

setQuery

void setQuery(String query)
Sets a new fulltext query that will be executed.

Parameters:
query - the fulltext query.

getQuery

String getQuery()
Returns:
the query supplied by the user.

setSearchIn

void setSearchIn(String searchIn)
Parameters:
searchIn - the location where to search in.

getSearchIn

String getSearchIn()
Returns:
the location where to search in.

setHitsPerPage

void setHitsPerPage(long num)
Parameters:
num - the number of hits to display on a page.

getHitsPerPage

long getHitsPerPage()
Returns:
the number of hits to display per page.

getStart

long getStart()
Returns:
offset in the actual search results to start from

setStart

void setStart(long start)
This sets an offset for the actual search results, ie. it will skip the first N (= start) items of the underlying result iterator.

Parameters:
start - the offset in the actual search results to start from

addPredicate

void addPredicate(Predicate predicate)
Allows to add custom predicates for the underlying Query.

Parameters:
predicate - a search predicate

getResult

SearchResult getResult()
                       throws RepositoryException
Returns:
the query result or null if there is no query parameter set.
Throws:
RepositoryException - if an exception occurs while executing the query.

getTrends

Trends getTrends()
Returns:
query trends (popular queries).

getRelatedQueries

List<String> getRelatedQueries()
                               throws RepositoryException
Returns:
queries that are related to the current one.
Throws:
RepositoryException - if an error occurs while reading from the repository.

setSearchProperties

void setSearchProperties(String properties)
Parameters:
properties - comma separated names of the properties that will be searched.

getSearchProperties

String getSearchProperties()
Returns:
the names of the properties that will be searched.

setExcerptPropertyNames

void setExcerptPropertyNames(String properties)
Parameters:
properties - comma separated names of the properties that will be used in an excerpt.

getExcerptPropertyNames

String getExcerptPropertyNames()
Returns:
the names of the properties that will be used in an excerpt.


Copyright © 2009 Day Management AG. All Rights Reserved.