|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.search.highlight.HighlightBuilder
public class HighlightBuilder
A builder for search highlighting.
SearchSourceBuilder.highlight()
Nested Class Summary | |
---|---|
static class |
HighlightBuilder.Field
|
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent |
---|
ToXContent.MapParams, ToXContent.Params |
Field Summary |
---|
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent |
---|
EMPTY_PARAMS |
Constructor Summary | |
---|---|
HighlightBuilder()
|
Method Summary | |
---|---|
HighlightBuilder |
encoder(String encoder)
Set encoder for the highlighting are styled and default. |
HighlightBuilder |
field(HighlightBuilder.Field field)
|
HighlightBuilder |
field(String name)
Adds a field to be highlighted with default fragment size of 100 characters, and default number of fragments of 5 using the default encoder |
HighlightBuilder |
field(String name,
int fragmentSize)
Adds a field to be highlighted with a provided fragment size (in characters), and default number of fragments of 5. |
HighlightBuilder |
field(String name,
int fragmentSize,
int numberOfFragments)
Adds a field to be highlighted with a provided fragment size (in characters), and a provided (maximum) number of fragments. |
HighlightBuilder |
field(String name,
int fragmentSize,
int numberOfFragments,
int fragmentOffset)
Adds a field to be highlighted with a provided fragment size (in characters), and a provided (maximum) number of fragments. |
HighlightBuilder |
order(String order)
The order of fragments per field. |
HighlightBuilder |
postTags(String... postTags)
Explicitly set the post tags that will be used for highlighting. |
HighlightBuilder |
preTags(String... preTags)
Explicitly set the pre tags that will be used for highlighting. |
HighlightBuilder |
requireFieldMatch(boolean requireFieldMatch)
|
HighlightBuilder |
tagsSchema(String schemaName)
Set a tag scheme that encapsulates a built in pre and post tags. |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HighlightBuilder()
Method Detail |
---|
public HighlightBuilder field(String name)
name
- The field to highlightpublic HighlightBuilder field(String name, int fragmentSize)
name
- The field to highlightfragmentSize
- The size of a fragment in characterspublic HighlightBuilder field(String name, int fragmentSize, int numberOfFragments)
name
- The field to highlightfragmentSize
- The size of a fragment in charactersnumberOfFragments
- The (maximum) number of fragmentspublic HighlightBuilder field(String name, int fragmentSize, int numberOfFragments, int fragmentOffset)
name
- The field to highlightfragmentSize
- The size of a fragment in charactersnumberOfFragments
- The (maximum) number of fragmentsfragmentOffset
- The offset from the start of the fragment to the start of the highlightpublic HighlightBuilder field(HighlightBuilder.Field field)
public HighlightBuilder tagsSchema(String schemaName)
schemaName
- The tag scheme namepublic HighlightBuilder encoder(String encoder)
encoder
- namepublic HighlightBuilder preTags(String... preTags)
public HighlightBuilder postTags(String... postTags)
public HighlightBuilder order(String order)
public HighlightBuilder requireFieldMatch(boolean requireFieldMatch)
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |