@StableMinor(version="12.0", sinceVersion="9.0") public class SearchQuery extends Object
searcher
.IBigDataSearcher
Constructor and Description |
---|
SearchQuery()
|
SearchQuery(String query)
|
Modifier and Type | Method and Description |
---|---|
SearchQuery |
addAggregation(IAggregation aggregation)
Adds the given aggregation in this search query.
|
SearchQuery |
addAggregations(IAggregation... aggregations)
Adds the given aggregations in this search query.
|
SearchQuery |
addAggregations(List<IAggregation> aggregations)
Adds the given aggregations in this search query.
|
SearchQuery |
addFieldBoost(DocumentTypeField documentTypeField,
float boost)
Adds a field boost to search.
|
SearchQuery |
addFieldBoost(String fieldId,
float boost)
Adds a field boost to search.
|
SearchQuery |
addSort(ISearchQuerySort sort)
Adds a sort definition in this search.
|
List<IAggregation> |
getAggregations()
Returns an unmodifiable list of the added aggregations.
|
ISearchQueryFilter |
getControlFilter()
Returns a query filter to be applied to the search.
|
Map<DocumentTypeField,Float> |
getFieldsBoost()
Returns the field boosting configuration.
|
HighlightConfig |
getHighlight()
Returns the highlight configuration.
|
int |
getMaxRows()
|
List<ISearchQuerySort> |
getSorts()
Returns an unmodifiable list of added sorts.
|
int |
getStartAt()
|
String |
getUserQuery()
Returns the user query, which is the user-defined portion of the
query , usually entered by
the final user using front-end interfaces. |
SearchQuery |
setControlFilter(ISearchQueryFilter controlFilter)
Sets the query filter to be applied to the search.
|
SearchQuery |
setHighlight(HighlightConfig highlight)
Sets the highlight configuration.
|
SearchQuery |
setMaxRows(int maxRows)
Sets the
maximum number of hits . |
SearchQuery |
setStartAt(int startAt)
Sets the
number of the first hit .This number is 1-based (the first result is the result number 1). |
SearchQuery |
setUserQuery(String query)
Sets the
user query . |
public SearchQuery()
public SearchQuery(String query)
query
- {@link #getUserQuery() user querypublic String getUserQuery()
query
, usually entered by
the final user using front-end interfaces.
The searcher
can and usually perform a tokenization in the user query in the same way
they do in the contents
during the indexing process.
public SearchQuery setUserQuery(String query)
user query
.query
- the user query
. If the given user query is a blank string or null
, it is equivalent
to not having an user query.public int getMaxRows()
hits
to be returned by the query
execution
.
Usually this setting is used to paginate the search results
.
public SearchQuery setMaxRows(int maxRows)
maximum number of hits
.maxRows
- the maximum number of hitspublic int getStartAt()
hit
to be returned by the query
execution
.
Usually this setting is used to paginate the search results
.
This number is 1-based (the first result is the result number 1).
hit
public SearchQuery setStartAt(int startAt)
number of the first hit
.startAt
- the number of the first hit
public ISearchQueryFilter getControlFilter()
null
if none was specified.#getControlQuery()
public SearchQuery setControlFilter(ISearchQueryFilter controlFilter)
the
- query filter.#setControlQuery(String)
public SearchQuery addSort(ISearchQuerySort sort)
sort
- the sort definition.public List<ISearchQuerySort> getSorts()
public SearchQuery setHighlight(HighlightConfig highlight)
highlight
- the highlight configuration.public HighlightConfig getHighlight()
public SearchQuery addAggregation(IAggregation aggregation)
aggregation
- the aggregation.public SearchQuery addAggregations(IAggregation... aggregations)
aggregations
- the aggregations.public SearchQuery addAggregations(List<IAggregation> aggregations)
aggregations
- the aggregations.public List<IAggregation> getAggregations()
public SearchQuery addFieldBoost(String fieldId, float boost) throws PortalObjectNotFoundException
a user query
is present in search query.fieldId
- the identifier of the field to be boosted.boost
- the boost value.PortalObjectNotFoundException
- if no field with the given identifier could be found.public SearchQuery addFieldBoost(DocumentTypeField documentTypeField, float boost)
a user query
is present in search query.documentTypeField
- the field to be boosted.boost
- the boost value.PortalObjectNotFoundException
- if no field with the given identifier could be found.IllegalArgumentException
- if the field is not indexed.IllegalArgumentException
- if the boost value is not positive.DocumentTypeField.getIndexMode()
public Map<DocumentTypeField,Float> getFieldsBoost()
LumisXP 12.0.0.190809 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.