Stay organized with collections
Save and categorize content based on your preferences.
publicclassFieldExpression
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,
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".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class FieldExpression (2.0.0)\n\n public class FieldExpression\n\nRepresents an expression bound to a returned Field with the given\nname. FieldExpressions are added to a [QueryOptions](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.QueryOptions), to request an\nexpression computed and returned as the named Field value. For example, \n\n\n FieldExpression.newBuilder()\n .setName(\"snippet\")\n .setExpression(\"snippet(\"good story\", content)\")\n .build()\n \nbinds a snippet expression to a Field named \"snippet\", which will\nbe returned in each search result. In this case the returned \"snippet\"\nField will contain a HTML value containing text snippets of the\n\"content\" field matching the query \"good story\". \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e FieldExpression \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### newBuilder()\n\n public static FieldExpression.Builder newBuilder()\n\nMethods\n-------\n\n### getExpression()\n\n public String getExpression()\n\n### getName()\n\n public String getName()\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]