| |
|
| java.lang.Object org.opencms.search.CmsSearchParameters
Field Summary | |
final public static Sort | SORT_DATE_CREATED Sort result documents by date of creation, then score. | final public static Sort | SORT_DATE_LASTMODIFIED Sort result documents by date of last modification, then score. | final public static Sort | SORT_DEFAULT Default sort order (by document score - for this null gave best performance). | final public static String[] | SORT_NAMES Names of the default sort options. | final public static Sort | SORT_TITLE Sort result documents by title, then score. | protected int | m_displayPages The number of displayed pages returned by getPageLinks(). | protected int | m_matchesPerPage The number of matches per page. |
Constructor Summary | |
public | CmsSearchParameters() Creates a new search parameter instance with no search query and
default values for the remaining parameters. | public | CmsSearchParameters(String query) Creates a new search parameter instance with the provided search query and
default values for the remaining parameters. | public | CmsSearchParameters(String query, List fields, List roots, List categories, boolean calculateCategories, Sort sort) |
SORT_DATE_CREATED | final public static Sort SORT_DATE_CREATED(Code) | | Sort result documents by date of creation, then score.
|
SORT_DATE_LASTMODIFIED | final public static Sort SORT_DATE_LASTMODIFIED(Code) | | Sort result documents by date of last modification, then score.
|
SORT_DEFAULT | final public static Sort SORT_DEFAULT(Code) | | Default sort order (by document score - for this null gave best performance).
|
SORT_NAMES | final public static String[] SORT_NAMES(Code) | | Names of the default sort options.
|
SORT_TITLE | final public static Sort SORT_TITLE(Code) | | Sort result documents by title, then score.
|
m_displayPages | protected int m_displayPages(Code) | | The number of displayed pages returned by getPageLinks().
|
m_matchesPerPage | protected int m_matchesPerPage(Code) | | The number of matches per page.
|
CmsSearchParameters | public CmsSearchParameters()(Code) | | Creates a new search parameter instance with no search query and
default values for the remaining parameters.
Before using this search parameters for a search method
CmsSearchParameters.setQuery(String) has to be invoked.
|
CmsSearchParameters | public CmsSearchParameters(String query)(Code) | | Creates a new search parameter instance with the provided search query and
default values for the remaining parameters.
Only the "meta" field (combination of content and title) will be used for search.
No search root restriction is chosen.
No category restriction is used.
No categorie counts are calculated for the result.
Sorting is turned off. This is a simple but fast setup.
Parameters: query - the query to search for |
CmsSearchParameters | public CmsSearchParameters(String query, List fields, List roots, List categories, boolean calculateCategories, Sort sort)(Code) | | Creates a new search parameter instance with the provided parameter values.
Parameters: query - the search term to search the index Parameters: fields - the list of fields to search Parameters: roots - only resource that are sub-resource of one of the search roots are included in the search result Parameters: categories - the list of categories to limit the search to Parameters: calculateCategories - if true , the category count is calculated for all search results(use with caution, this option uses much performance) Parameters: sort - the sort order for the search |
getCalculateCategories | public boolean getCalculateCategories()(Code) | | Returns wether category counts are calculated for search results or not.
a boolean that tells wether category counts are calculated for search results or not |
getCategories | public List getCategories()(Code) | | Returns the list of categories to limit the search to.
the list of categories to limit the search to |
getDisplayPages | public int getDisplayPages()(Code) | | Returns the maximum number of pages which should be shown.
the maximum number of pages which should be shown |
getFields | public List getFields()(Code) | | Returns the list of search index field names (Strings) to search in.
the list of search index field names (Strings) to search in |
getIndex | public String getIndex()(Code) | | Get the name of the index for the search.
the name of the index for the search |
getMatchesPerPage | public int getMatchesPerPage()(Code) | | Gets the number of matches displayed on each page.
matches per result page |
getMaxDateCreated | public long getMaxDateCreated()(Code) | | Returns the creation date the resources have to have as maximum.
the creation date the resources have to have as maximum |
getMaxDateLastModified | public long getMaxDateLastModified()(Code) | | Returns the last modification date the resources have to have as maximum.
the last modification date the resources have to have as maximum |
getMinDateCreated | public long getMinDateCreated()(Code) | | Returns the creation date the resources have to have as minimum.
the creation date the resources have to have as minimum |
getMinDateLastModified | public long getMinDateLastModified()(Code) | | Returns the last modification date the resources have to have as minimum.
the last modification date the resources have to have as minimum |
getQuery | public String getQuery()(Code) | | Returns the search query to use.
the search query to use |
getQueryLength | public int getQueryLength()(Code) | | Gets the minimum search query length.
the minimum search query length |
getRoots | public List getRoots()(Code) | | Returns the list of strings of search roots to use.
Only resource that are sub-resource of one of the search roots are included in the search result.
the list of strings of search roots to use |
getSearchCategories | public String getSearchCategories()(Code) | | Returns the list of categories to limit the search to.
the list of categories to limit the search to |
getSearchPage | public int getSearchPage()(Code) | | Returns the search page to display.
the search page to display |
getSort | public Sort getSort()(Code) | | Returns the instance that defines the sort order for the results.
the instance that defines the sort order for the results |
isCalculateCategories | public boolean isCalculateCategories()(Code) | | Returns true if the category count is calculated for all search results.
true if the category count is calculated for all search results |
isExcerptOnlySearchedFields | public boolean isExcerptOnlySearchedFields()(Code) | | Returns true if fields configured for the excerpt should be used for generating the excerpt only
if they have been actually searched in.
The default setting is false , which means all text fields configured for the excerpt will
be used to gernerate the excerpt, regardless if they have been searched in or not.
Please note: A field will only be included in the excerpt if it has been configured as excerpt="true"
in opencms-search.xml . This method controls if so configured fields are used depending on the
fields searched, see
CmsSearchParameters.setFields(List) .
true if fields configured for the excerpt should be used for generating the excerpt only if they have been actually searched in |
setCalculateCategories | public void setCalculateCategories(boolean flag)(Code) | | Set wether category counts shall be calculated for the corresponding search results or not.
Parameters: flag - true if category counts shall be calculated for the corresponding search results or false if not |
setCategories | public void setCategories(List categories)(Code) | | Set the list of categories (strings) to this parameters.
Parameters: categories - the list of categories (strings) of this parameters |
setDisplayPages | public void setDisplayPages(int value)(Code) | | Sets the maximum number of pages which should be shown.
Enter an odd value to achieve a nice, "symmetric" output.
Parameters: value - the maximum number of pages which should be shown |
setExcerptOnlySearchedFields | public void setExcerptOnlySearchedFields(boolean excerptAllFields)(Code) | | Controls if the excerpt from a field is generated only for searched fields, or for all fields (the default).
Parameters: excerptAllFields - if true , the excerpt is generated only from the fields actually searched in See Also: CmsSearchParameters.isExcerptOnlySearchedFields() |
setFields | public void setFields(List fields)(Code) | | Sets the list of strings of names of fields to search in.
Parameters: fields - the list of strings of names of fields to search in to set |
setIndex | public void setIndex(String indexName)(Code) | | Set the name of the index to search.
Parameters: indexName - the name of the index |
setMatchesPerPage | public void setMatchesPerPage(int matches)(Code) | | Sets the number of matches per page.
Parameters: matches - the number of matches per page |
setMaxDateCreated | public void setMaxDateCreated(long dateCreatedTo)(Code) | | Sets the creation date the resources have to have as maximum.
Parameters: dateCreatedTo - the creation date the resources have to have as maximum to set |
setMaxDateLastModified | public void setMaxDateLastModified(long dateLastModifiedTo)(Code) | | Sets the last modification date the resources have to have as maximum.
Parameters: dateLastModifiedTo - the last modification date the resources have to have as maximum to set |
setMinDateCreated | public void setMinDateCreated(long dateCreatedFrom)(Code) | | Sets the creation date the resources have to have as minimum.
Parameters: dateCreatedFrom - the creation date the resources have to have as minimum to set |
setMinDateLastModified | public void setMinDateLastModified(long dateLastModifiedFrom)(Code) | | Sets the last modification date the resources have to have as minimum.
Parameters: dateLastModifiedFrom - the the last modification date the resources have to have as minimum to set |
setQuery | public void setQuery(String query)(Code) | | Sets the query to search for.
The decoding here is tailored for query strings that are
additionally manually utf-8 encoded at client side (javascript) to get around an
issue with special chars in applications that use non- utf-8 encoding
(e.g. ISO-8859-1) OpenCms applications. It is not recommended to use this with
frontends that don't encode manually as characters like sole "%" (without number suffix)
will cause an Exception.
Parameters: query - the querye to search for to set |
setQueryLength | public void setQueryLength(int length)(Code) | | Sets the minimum length of the search query.
Parameters: length - the minimum search query length |
setRoots | public void setRoots(List roots)(Code) | | Sets the list of strings of roots to search under for the search.
Parameters: roots - the list of strings of roots to search under for the search to set |
setSearchCategories | public void setSearchCategories(String categories)(Code) | | Set the comma separated search root names to restrict search to.
Parameters: categories - the comma separated category names to restrict search to |
setSearchPage | public void setSearchPage(int page)(Code) | | Set the search page to display.
Parameters: page - the search page to display |
setSearchRoots | public void setSearchRoots(String rootNameList)(Code) | | Set the comma separated search root names to restrict search to.
Parameters: rootNameList - the comma separated search root names to restrict search to |
setSort | public void setSort(Sort sortOrder)(Code) | | Set the instance that defines the sort order for search results.
Parameters: sortOrder - the instance that defines the sort order for search results to set |
toQueryString | public String toQueryString()(Code) | | Creates a query String build from this search parameters for HTML links.
a query String build from this search parameters for HTML links |
|
|
|