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
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RELATED_PREFIX
The prefix for a query searches for similar content.
|
Modifier and Type | Method and Description |
---|---|
void |
addPredicate(Predicate predicate)
Allows to add custom predicates for the underlying
Query . |
long |
getHitsPerPage()
Returns the number of hits to include per
ResultPage , ie. |
java.lang.String |
getQuery()
Returns the query term supplied by the user.
|
java.util.List<java.lang.String> |
getRelatedQueries()
Returns queries that are related to the current one.
|
SearchResult |
getResult()
Returns the search result object.
|
java.lang.String |
getSearchIn()
Returns the repository path where to search in.
|
java.lang.String |
getSearchProperties()
Returns the comma-separated list of properties that will be searched for
the term given in
setQuery(String) . |
long |
getStart()
Returns the offset in the actual search results to start from.
|
Trends |
getTrends()
Returns a object with access to query trend statistics.
|
void |
setHitsPerPage(long num)
Sets the number of hits to include on a
ResultPage . |
void |
setQuery(java.lang.String query)
Sets a new fulltext query that will be executed.
|
void |
setSearchIn(java.lang.String searchIn)
Sets the repository path where to search in.
|
void |
setSearchProperties(java.lang.String properties)
Sets the comma-separated list of properties that will be searched for the term given in
setQuery(String) . |
void |
setStart(long start)
This sets an offset for the actual search results, ie.
|
static final java.lang.String RELATED_PREFIX
void setQuery(java.lang.String query)
If this is called after getResult()
has been called, i.e. the
query was executed already, this will lead to the next
getResult()
call executing the new query again.
query
- the fulltext query.java.lang.String getQuery()
void setSearchIn(java.lang.String searchIn)
If this is called after getResult()
has been called, i.e. the
query was executed already, this will lead to the next
getResult()
call executing the new query again.
searchIn
- the location where to search in.java.lang.String getSearchIn()
void setHitsPerPage(long num)
ResultPage
. Since only
the first page is returned directly and typically fully read by clients,
this can also be seen as "limit" for the search result. Further results
can be accessed either by retrieving the
next result page
or by running a new
query and setting the start
parameter (often also
called "offset"). For unlimited results on a single page, use 0. Default
value is 10.
If this is called after getResult()
has been called, i.e. the
query was executed already, this will lead to the next
getResult()
call executing the new query again.
num
- the number of hits to include on a result page (0 for
unlimited results)long getHitsPerPage()
ResultPage
, ie. the
limit. See setHitsPerPage(long)
.void setStart(long start)
start
) items of the underlying result iterator.
By default this is 0, ie. right from the very beginning.
If this is called after getResult()
has been called, i.e. the
query was executed already, this will lead to the next
getResult()
call executing the new query again.
start
- the offset in the actual search results to start fromlong getStart()
setStart(long)
.void addPredicate(Predicate predicate)
Query
.
If this is called after getResult()
has been called, i.e. the
query was executed already, this will lead to the next
getResult()
call executing the new query again.
predicate
- a search predicateSearchResult getResult() throws RepositoryException
null
if there is no query
parameter set.RepositoryException
- if an exception occurs while executing the query.Trends getTrends()
java.util.List<java.lang.String> getRelatedQueries() throws RepositoryException
RepositoryException
- if an error occurs while reading from the repository.void setSearchProperties(java.lang.String properties)
setQuery(String)
.
If this is called after getResult()
has been called, i.e. the
query was executed already, this will lead to the next
getResult()
call executing the new query again.
properties
- comma separated names of the properties that will be searched.java.lang.String getSearchProperties()
setQuery(String)
.Copyright © 2010 - 2020 Adobe. All Rights Reserved