Class FieldExpression (2.0.0)

public class FieldExpression

Represents an expression bound to a returned Field with the given name. FieldExpressions are added to a QueryOptions, to request an expression computed and returned as the named Field value. For example,


   FieldExpression.newBuilder()
       .setName("snippet")
       .setExpression("snippet("good story", content)")
       .build()
 

binds a snippet expression to a Field named "snippet", which will be returned in each search result. In this case the returned "snippet" Field will contain a HTML value containing text snippets of the "content" field matching the query "good story".

Inheritance

java.lang.Object > FieldExpression

Static Methods

newBuilder()

public static FieldExpression.Builder newBuilder()
Returns
Type Description
FieldExpression.Builder

returns a new FieldExpression builder.

Methods

getExpression()

public String getExpression()
Returns
Type Description
String

the expression string used to create a field

getName()

public String getName()
Returns
Type Description
String

the name of the expression

toString()

public String toString()
Returns
Type Description
String
Overrides