Class ResultField
- java.lang.Object
-
- co.elasticsearch.enterprisesearch.client.model.request.search.ResultField
-
public class ResultField extends Object
Represents a field in a search results document
-
-
Constructor Summary
Constructors Constructor Description ResultField()Create a blank result fieldResultField(String name)Create a result field with the given name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetName()The name of the fieldinthashCode()ResultFieldsetName(String name)The name of the fieldResultFieldsetRaw(co.elasticsearch.enterprisesearch.client.model.request.search.ResultFieldRendered raw)An exact representation of the value within a field.ResultFieldsetSnippet(co.elasticsearch.enterprisesearch.client.model.request.search.ResultFieldRendered snippet)A snippet is an HTML escaped representation of the value within a field, where query matches are captured in<em>tags.ResultFieldwithoutRaw()Disable the return of the raw representation of this fieldResultFieldwithoutSnippet()Disable the return of the snippet representation of this fieldResultFieldwithRaw()Enable the return of the raw representation of this fieldResultFieldwithRaw(int size)Enable the return of the raw representation of this field, with the given field size maxResultFieldwithSnippet()Enable the return of the snippet representation of this fieldResultFieldwithSnippet(int size)Enable the return of the snippet representation of this field, with the given max lengthResultFieldwithSnippet(int size, Boolean fallback)Enable the return of the snippet representation of this field, with given max length, and fallback field configResultFieldwithSnippet(Boolean fallback)Enable the return of the snippet representation of this field, with fallback field config
-
-
-
Constructor Detail
-
ResultField
public ResultField()
Create a blank result field
-
ResultField
public ResultField(String name)
Create a result field with the given name- Parameters:
name- the field name
-
-
Method Detail
-
withRaw
public ResultField withRaw()
Enable the return of the raw representation of this field- Returns:
- this field
-
withRaw
public ResultField withRaw(int size)
Enable the return of the raw representation of this field, with the given field size max- Parameters:
size- the maximum number of characters to return- Returns:
- this field
-
withoutRaw
public ResultField withoutRaw()
Disable the return of the raw representation of this field- Returns:
- this field
-
withSnippet
public ResultField withSnippet()
Enable the return of the snippet representation of this field- Returns:
- this field
-
withSnippet
public ResultField withSnippet(int size)
Enable the return of the snippet representation of this field, with the given max length- Parameters:
size- Character length of the snippet returned. Must be at least 20; defaults to 100.- Returns:
- this field
-
withSnippet
public ResultField withSnippet(int size, Boolean fallback)
Enable the return of the snippet representation of this field, with given max length, and fallback field config- Parameters:
size- Character length of the snippet returned. Must be at least 20; defaults to 100.fallback- If true, return the raw text field if no snippet is found. If false, only use snippets.- Returns:
- this field
-
withSnippet
public ResultField withSnippet(Boolean fallback)
Enable the return of the snippet representation of this field, with fallback field config- Parameters:
fallback- If true, return the raw text field if no snippet is found. If false, only use snippets.- Returns:
- this field
-
withoutSnippet
public ResultField withoutSnippet()
Disable the return of the snippet representation of this field- Returns:
- this field
-
getName
public String getName()
The name of the field- Returns:
- the field name
-
setName
public ResultField setName(String name)
The name of the field- Parameters:
name- the field name- Returns:
this.
-
setRaw
public ResultField setRaw(co.elasticsearch.enterprisesearch.client.model.request.search.ResultFieldRendered raw)
An exact representation of the value within a field. And it is exact! It is not HTML escaped.- Parameters:
raw- The raw field- Returns:
this.
-
setSnippet
public ResultField setSnippet(co.elasticsearch.enterprisesearch.client.model.request.search.ResultFieldRendered snippet)
A snippet is an HTML escaped representation of the value within a field, where query matches are captured in<em>tags.- Parameters:
snippet- The snippet field- Returns:
this.
-
-