|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.day.cq.wcm.foundation.Search
public final class Search
Search implements the search logic and exposes the query result
in a scripting friendly object structure.
| Nested Class Summary | |
|---|---|
class |
Search.Hit
A hit within the search result. |
class |
Search.Page
A result page. |
class |
Search.Result
A search result. |
| Field Summary | |
|---|---|
static String |
FROM_FACET_PARAM_NAME
The name for the last modified facet parameter, which specifies the lower bound of the date range. |
static String |
LANGUAGE_FACET_PARAM_NAME
The name for the language facet parameter. |
static String |
MIME_TYPE_FACET_PARAM_NAME
The name for the mime type facet parameter. |
static String |
QUERY_PARAM_NAME
The name for the query parameter. |
static String |
START_PARAM_NAME
The name for the start parameter. |
static String |
TAG_FACET_PARAM_NAME
The name for the tag facet parameter. |
static String |
TO_FACET_PARAM_NAME
The name for the last modified facet parameter, which specifies the upper bound of the date range. |
| Constructor Summary | |
|---|---|
Search(org.apache.sling.api.SlingHttpServletRequest request)
Creates a new search based on the given request. |
|
| Method Summary | |
|---|---|
protected void |
appendConstraints(StringBuffer stmt,
String relPath,
String[] values)
Appends value constraints for the property with the given relPath. |
String |
getExcerptPropertyNames()
|
long |
getHitsPerPage()
|
String |
getQuery()
|
List<String> |
getRelatedQueries()
|
Search.Result |
getResult()
|
String |
getSearchIn()
|
String |
getSearchProperties()
|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String QUERY_PARAM_NAME
public static final String START_PARAM_NAME
public static final String LANGUAGE_FACET_PARAM_NAME
public static final String TAG_FACET_PARAM_NAME
public static final String MIME_TYPE_FACET_PARAM_NAME
public static final String FROM_FACET_PARAM_NAME
public static final String TO_FACET_PARAM_NAME
| Constructor Detail |
|---|
public Search(org.apache.sling.api.SlingHttpServletRequest request)
request.
request - the current request.| Method Detail |
|---|
public Trends getTrends()
public Search.Result getResult()
throws RepositoryException
null if there is no query
parameter set.
RepositoryException - if an exception occurs while executing the
query.
public List<String> getRelatedQueries()
throws RepositoryException
RepositoryException - if an error occurs while reading from
the repository.public String getQuery()
public void setQuery(String query)
query - the fulltext query.public String getExcerptPropertyNames()
public void setExcerptPropertyNames(String properties)
properties - comma separated names of the properties that will be
used in an excerpt.public long getHitsPerPage()
public void setHitsPerPage(long num)
num - the number of hits to display on a page.public String getSearchIn()
public void setSearchIn(String searchIn)
searchIn - the location where to search in.public String getSearchProperties()
public void setSearchProperties(String properties)
properties - comma separated names of the properties that will be searched.
protected void appendConstraints(StringBuffer stmt,
String relPath,
String[] values)
relPath.
stmt - the query statement.relPath - the relative path to a property.values - the values, or null if no constraints.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||