Class HighlightOptions
java.lang.Object
org.springframework.data.solr.core.query.HighlightOptions
Empty Options indicate to set
hl=true. As long as there are no fields defined * will be used. Some
options like can be set directly. Any option can be set via
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classField with hightlight query parametersstatic classQuery Parameter to be used for highlighting -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd name of field to highlight onAdd names of fields to highlight onAdd field to highlightaddFields(Collection<String> fieldnames) Add names of fields to highlight onaddHighlightParameter(String parameterName, Object value) Add parameter by nameAdd parameterGet Collection of fields that have field specific highlight options.<S> SgetHighlightParameterValue(String parameterName) Get value of parameter with given typegetQuery()booleanbooleanhasQuery()setFormatter(String formatter) set formatterhl.formattersetFragsize(Integer fragsize) set fragsizehl.fragsize.setNrSnipplets(Integer nrSnipplets) sethl.snippetssetQuery(FilterQuery query) Set to be used forhl.qsetSimplePostfix(String postfix) sethl.simple.postsetSimplePrefix(String prefix) sethl.simple.pre
-
Field Details
-
ALL_FIELDS
-
-
Constructor Details
-
HighlightOptions
public HighlightOptions()
-
-
Method Details
-
addField
Add field to highlight- Parameters:
field-- Returns:
-
addField
Add name of field to highlight on- Parameters:
fieldname-- Returns:
-
addField
Add names of fields to highlight on- Parameters:
fieldnames-- Returns:
-
addFields
Add names of fields to highlight on- Parameters:
fieldnames-- Returns:
-
getQuery
- Returns:
- null if not set
-
setQuery
Set to be used forhl.q- Parameters:
query-
-
getFragsize
- Returns:
- null if not set
-
setFragsize
set fragsizehl.fragsize.- Parameters:
fragsize-
-
getFormatter
- Returns:
- null if not set
-
setFormatter
set formatterhl.formatter- Parameters:
formatter-
-
getNrSnipplets
- Returns:
- null if not set
-
setNrSnipplets
sethl.snippets- Parameters:
nrSnipplets-
-
setSimplePrefix
sethl.simple.pre- Parameters:
prefix-
-
getSimplePrefix
- Returns:
-
setSimplePostfix
sethl.simple.post- Parameters:
postfix-
-
getSimplePostfix
- Returns:
-
getFields
- Returns:
- unmodifiable list of fields
-
getHighlightParameters
- Returns:
- collection of all parameters
-
addHighlightParameter
Add parameter by name- Parameters:
parameterName- must not be nullvalue-- Returns:
-
addHighlightParameter
Add parameter- Parameters:
parameter- must not be null- Returns:
-
getHighlightParameterValue
Get value of parameter with given type- Parameters:
parameterName-- Returns:
- null if not present
-
getFieldsWithHighlightParameters
Get Collection of fields that have field specific highlight options.- Returns:
-
hasQuery
public boolean hasQuery()- Returns:
- true if query is not null
-
hasFields
public boolean hasFields()- Returns:
- true if at least one field available
-