Class Highlight
- java.lang.Object
-
- com.lucidworks.search.dsl.DslBase
-
- com.lucidworks.search.dsl.request.DslCloneable
-
- com.lucidworks.search.dsl.request.Highlight
-
public class Highlight extends DslCloneable
Specifies how matching document fragments ("highlights") are calculated and incorporated into the returned results.
-
-
Constructor Summary
Constructors Constructor Description Highlight(java.util.Collection<java.lang.String> fields, java.lang.String pre, java.lang.String post, java.lang.Integer length, java.lang.Integer count, java.lang.Boolean defaultHighlight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Highlight
clone()
java.lang.Integer
getCount()
java.lang.Boolean
getDefaultHighlight()
java.util.Collection<java.lang.String>
getFields()
java.lang.Integer
getLength()
java.lang.String
getPost()
java.lang.String
getPre()
void
setCount(java.lang.Integer count)
void
setDefaultHighlight(java.lang.Boolean defaultHighlight)
void
setFields(java.util.Collection<java.lang.String> fields)
void
setLength(java.lang.Integer length)
void
setPost(java.lang.String post)
void
setPre(java.lang.String pre)
-
Methods inherited from class com.lucidworks.search.dsl.request.DslCloneable
clone, deepClone
-
-
-
-
Method Detail
-
getFields
public java.util.Collection<java.lang.String> getFields()
- Returns:
- the fields to consider for highlighting. Wildcard-based values ("*", "text_lang_*", etc.) are allowed but should be used carefully to avoid impacting performance.
-
setFields
public void setFields(java.util.Collection<java.lang.String> fields)
-
getLength
public java.lang.Integer getLength()
- Returns:
- the target size for highlight fragments, in characters. "0" is treated as a flag value to indicate that the entire field value should be used as the fragment. Defaults to "100" if not specified.
-
setLength
public void setLength(java.lang.Integer length)
-
getCount
public java.lang.Integer getCount()
- Returns:
- the number of highlight fragments to attempt to generate per field. Defaults to 1.
-
setCount
public void setCount(java.lang.Integer count)
-
getDefaultHighlight
public java.lang.Boolean getDefaultHighlight()
- Returns:
- whether or not a default highlight fragment should be included where none could be generated. Defaults to false.
-
setDefaultHighlight
public void setDefaultHighlight(java.lang.Boolean defaultHighlight)
-
getPre
public java.lang.String getPre()
- Returns:
- the text that will be prepended to each highlighted fragment. Typically a HTML or XML opening tag, though any string may be used. Defaults to <em>
-
setPre
public void setPre(java.lang.String pre)
-
getPost
public java.lang.String getPost()
- Returns:
- the text that will be appended to each highlighted fragment. Typically a HTML or XML closing tag, though any string may be used. Defaults to </em>
-
setPost
public void setPost(java.lang.String post)
-
clone
public Highlight clone()
- Specified by:
clone
in classDslCloneable
-
-