public abstract class QueryBuilders
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static BoolQueryBuilder |
boolQuery()
A Query that matches documents matching boolean combinations of other queries.
|
static BoostingQueryBuilder |
boostingQuery(QueryBuilder positiveQuery,
QueryBuilder negativeQuery)
The BoostingQuery class can be used to effectively demote results that match a given query.
|
static CommonTermsQueryBuilder |
commonTermsQuery(java.lang.String fieldName,
java.lang.Object text)
Creates a common query for the provided field name and text.
|
static ConstantScoreQueryBuilder |
constantScoreQuery(QueryBuilder queryBuilder)
A query that wraps another query and simply returns a constant score equal to the
query boost for every document in the query.
|
static DisMaxQueryBuilder |
disMaxQuery()
A query that generates the union of documents produced by its sub-queries, and that scores each document
with the maximum score for that document as produced by any sub-query, plus a tie breaking increment for any
additional matching sub-queries.
|
static ExistsQueryBuilder |
existsQuery(java.lang.String name)
A filter to filter only documents where a field exists in them.
|
static FieldMaskingSpanQueryBuilder |
fieldMaskingSpanQuery(SpanQueryBuilder query,
java.lang.String field) |
static FunctionScoreQueryBuilder |
functionScoreQuery(FunctionScoreQueryBuilder.FilterFunctionBuilder[] filterFunctionBuilders)
A query that allows to define a custom scoring function
|
static FunctionScoreQueryBuilder |
functionScoreQuery(QueryBuilder queryBuilder)
A function_score query with no functions.
|
static FunctionScoreQueryBuilder |
functionScoreQuery(QueryBuilder queryBuilder,
FunctionScoreQueryBuilder.FilterFunctionBuilder[] filterFunctionBuilders)
A query that allows to define a custom scoring function
|
static FunctionScoreQueryBuilder |
functionScoreQuery(QueryBuilder queryBuilder,
ScoreFunctionBuilder function)
A query that allows to define a custom scoring function.
|
static FunctionScoreQueryBuilder |
functionScoreQuery(ScoreFunctionBuilder function)
A query that allows to define a custom scoring function.
|
static FuzzyQueryBuilder |
fuzzyQuery(java.lang.String name,
java.lang.Object value)
A Query that matches documents using fuzzy query.
|
static FuzzyQueryBuilder |
fuzzyQuery(java.lang.String name,
java.lang.String value)
A Query that matches documents using fuzzy query.
|
static GeoBoundingBoxQueryBuilder |
geoBoundingBoxQuery(java.lang.String name)
A filter to filter based on a bounding box defined by top left and bottom right locations / points
|
static GeoShapeQueryBuilder |
geoDisjointQuery(java.lang.String name,
ShapeBuilder shape)
A filter to filter indexed shapes that are not intersection with the query shape
|
static GeoShapeQueryBuilder |
geoDisjointQuery(java.lang.String name,
java.lang.String indexedShapeId,
java.lang.String indexedShapeType) |
static GeoDistanceQueryBuilder |
geoDistanceQuery(java.lang.String name)
A filter to filter based on a specific distance from a specific geo location / point.
|
static GeoDistanceRangeQueryBuilder |
geoDistanceRangeQuery(java.lang.String name,
double lat,
double lon)
A filter to filter based on a specific range from a specific geo location / point.
|
static GeoDistanceRangeQueryBuilder |
geoDistanceRangeQuery(java.lang.String name,
GeoPoint point)
A filter to filter based on a specific range from a specific geo location / point.
|
static GeoDistanceRangeQueryBuilder |
geoDistanceRangeQuery(java.lang.String name,
java.lang.String geohash)
A filter to filter based on a specific range from a specific geo location / point.
|
static GeohashCellQuery.Builder |
geoHashCellQuery(java.lang.String name,
GeoPoint point)
A filter based on a bounding box defined by geohash.
|
static GeohashCellQuery.Builder |
geoHashCellQuery(java.lang.String name,
java.lang.String geohash)
A filter based on a bounding box defined by geohash.
|
static GeohashCellQuery.Builder |
geoHashCellQuery(java.lang.String name,
java.lang.String geohash,
boolean neighbors)
A filter based on a bounding box defined by geohash.
|
static GeoShapeQueryBuilder |
geoIntersectionQuery(java.lang.String name,
ShapeBuilder shape)
A filter to filter indexed shapes intersecting with shapes
|
static GeoShapeQueryBuilder |
geoIntersectionQuery(java.lang.String name,
java.lang.String indexedShapeId,
java.lang.String indexedShapeType) |
static GeoPolygonQueryBuilder |
geoPolygonQuery(java.lang.String name,
java.util.List<GeoPoint> points)
A filter to filter based on a polygon defined by a set of locations / points.
|
static GeoShapeQueryBuilder |
geoShapeQuery(java.lang.String name,
ShapeBuilder shape)
A filter based on the relationship of a shape and indexed shapes
|
static GeoShapeQueryBuilder |
geoShapeQuery(java.lang.String name,
java.lang.String indexedShapeId,
java.lang.String indexedShapeType) |
static GeoShapeQueryBuilder |
geoWithinQuery(java.lang.String name,
ShapeBuilder shape)
A filter to filter indexed shapes that are contained by a shape
|
static GeoShapeQueryBuilder |
geoWithinQuery(java.lang.String name,
java.lang.String indexedShapeId,
java.lang.String indexedShapeType) |
static IdsQueryBuilder |
idsQuery()
Constructs a query that will match only specific ids within all types.
|
static IdsQueryBuilder |
idsQuery(java.lang.String... types)
Constructs a query that will match only specific ids within types.
|
static IndicesQueryBuilder |
indicesQuery(QueryBuilder queryBuilder,
java.lang.String... indices)
Deprecated.
instead search on the `_index` field
|
static MatchAllQueryBuilder |
matchAllQuery()
A query that matches on all documents.
|
static MatchPhrasePrefixQueryBuilder |
matchPhrasePrefixQuery(java.lang.String name,
java.lang.Object text)
Creates a match query with type "PHRASE_PREFIX" for the provided field name and text.
|
static MatchPhraseQueryBuilder |
matchPhraseQuery(java.lang.String name,
java.lang.Object text)
Creates a text query with type "PHRASE" for the provided field name and text.
|
static MatchQueryBuilder |
matchQuery(java.lang.String name,
java.lang.Object text)
Creates a match query with type "BOOLEAN" for the provided field name and text.
|
static MoreLikeThisQueryBuilder |
moreLikeThisQuery(MoreLikeThisQueryBuilder.Item[] likeItems)
A more like this query that finds documents that are "like" the provided documents
which is checked against the "_all" field.
|
static MoreLikeThisQueryBuilder |
moreLikeThisQuery(java.lang.String[] likeTexts)
A more like this query that finds documents that are "like" the provided texts
which is checked against the "_all" field.
|
static MoreLikeThisQueryBuilder |
moreLikeThisQuery(java.lang.String[] likeTexts,
MoreLikeThisQueryBuilder.Item[] likeItems)
A more like this query that finds documents that are "like" the provided texts or documents
which is checked against the "_all" field.
|
static MoreLikeThisQueryBuilder |
moreLikeThisQuery(java.lang.String[] fields,
java.lang.String[] likeTexts,
MoreLikeThisQueryBuilder.Item[] likeItems)
A more like this query that finds documents that are "like" the provided texts or documents
which is checked against the fields the query is constructed with.
|
static MultiMatchQueryBuilder |
multiMatchQuery(java.lang.Object text,
java.lang.String... fieldNames)
Creates a match query with type "BOOLEAN" for the provided field name and text.
|
static NestedQueryBuilder |
nestedQuery(java.lang.String path,
QueryBuilder query,
org.apache.lucene.search.join.ScoreMode scoreMode) |
static PrefixQueryBuilder |
prefixQuery(java.lang.String name,
java.lang.String prefix)
A Query that matches documents containing terms with a specified prefix.
|
static QueryStringQueryBuilder |
queryStringQuery(java.lang.String queryString)
A query that parses a query string and runs it.
|
static RangeQueryBuilder |
rangeQuery(java.lang.String name)
A Query that matches documents within an range of terms.
|
static RegexpQueryBuilder |
regexpQuery(java.lang.String name,
java.lang.String regexp)
A Query that matches documents containing terms with a specified regular expression.
|
static ScriptQueryBuilder |
scriptQuery(Script script)
A builder for filter based on a script.
|
static SimpleQueryStringBuilder |
simpleQueryStringQuery(java.lang.String queryString)
A query that acts similar to a query_string query, but won't throw
exceptions for any weird string syntax.
|
static SpanContainingQueryBuilder |
spanContainingQuery(SpanQueryBuilder big,
SpanQueryBuilder little)
Creates a new
span_containing builder. |
static SpanFirstQueryBuilder |
spanFirstQuery(SpanQueryBuilder match,
int end) |
static SpanMultiTermQueryBuilder |
spanMultiTermQueryBuilder(MultiTermQueryBuilder multiTermQueryBuilder)
Creates a
SpanQueryBuilder which allows having a sub query
which implements MultiTermQueryBuilder . |
static SpanNearQueryBuilder |
spanNearQuery(SpanQueryBuilder initialClause,
int slop) |
static SpanNotQueryBuilder |
spanNotQuery(SpanQueryBuilder include,
SpanQueryBuilder exclude) |
static SpanOrQueryBuilder |
spanOrQuery(SpanQueryBuilder initialClause) |
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
double value) |
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
float value) |
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
int value) |
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
long value) |
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
java.lang.String value) |
static SpanWithinQueryBuilder |
spanWithinQuery(SpanQueryBuilder big,
SpanQueryBuilder little)
Creates a new
span_within builder. |
static TermQueryBuilder |
termQuery(java.lang.String name,
boolean value)
A Query that matches documents containing a term.
|
static TermQueryBuilder |
termQuery(java.lang.String name,
double value)
A Query that matches documents containing a term.
|
static TermQueryBuilder |
termQuery(java.lang.String name,
float value)
A Query that matches documents containing a term.
|
static TermQueryBuilder |
termQuery(java.lang.String name,
int value)
A Query that matches documents containing a term.
|
static TermQueryBuilder |
termQuery(java.lang.String name,
long value)
A Query that matches documents containing a term.
|
static TermQueryBuilder |
termQuery(java.lang.String name,
java.lang.Object value)
A Query that matches documents containing a term.
|
static TermQueryBuilder |
termQuery(java.lang.String name,
java.lang.String value)
A Query that matches documents containing a term.
|
static TermsQueryBuilder |
termsLookupQuery(java.lang.String name,
TermsLookup termsLookup)
A terms query that can extract the terms from another doc in an index.
|
static TermsQueryBuilder |
termsQuery(java.lang.String name,
java.util.Collection<?> values)
A filer for a field based on several terms matching on any of them.
|
static TermsQueryBuilder |
termsQuery(java.lang.String name,
double... values)
A filer for a field based on several terms matching on any of them.
|
static TermsQueryBuilder |
termsQuery(java.lang.String name,
float... values)
A filer for a field based on several terms matching on any of them.
|
static TermsQueryBuilder |
termsQuery(java.lang.String name,
int... values)
A filer for a field based on several terms matching on any of them.
|
static TermsQueryBuilder |
termsQuery(java.lang.String name,
long... values)
A filer for a field based on several terms matching on any of them.
|
static TermsQueryBuilder |
termsQuery(java.lang.String name,
java.lang.Object... values)
A filer for a field based on several terms matching on any of them.
|
static TermsQueryBuilder |
termsQuery(java.lang.String name,
java.lang.String... values)
A filer for a field based on several terms matching on any of them.
|
static TypeQueryBuilder |
typeQuery(java.lang.String type)
A filter based on doc/mapping type.
|
static WildcardQueryBuilder |
wildcardQuery(java.lang.String name,
java.lang.String query)
Implements the wildcard search query.
|
static WrapperQueryBuilder |
wrapperQuery(byte[] source)
A Query builder which allows building a query thanks to a JSON string or binary data.
|
static WrapperQueryBuilder |
wrapperQuery(BytesReference source)
A Query builder which allows building a query thanks to a JSON string or binary data.
|
static WrapperQueryBuilder |
wrapperQuery(java.lang.String source)
A Query builder which allows building a query thanks to a JSON string or binary data.
|
public static MatchAllQueryBuilder matchAllQuery()
public static MatchQueryBuilder matchQuery(java.lang.String name, java.lang.Object text)
name
- The field name.text
- The query text (to be analyzed).public static CommonTermsQueryBuilder commonTermsQuery(java.lang.String fieldName, java.lang.Object text)
fieldName
- The field name.text
- The query text (to be analyzed).public static MultiMatchQueryBuilder multiMatchQuery(java.lang.Object text, java.lang.String... fieldNames)
fieldNames
- The field names.text
- The query text (to be analyzed).public static MatchPhraseQueryBuilder matchPhraseQuery(java.lang.String name, java.lang.Object text)
name
- The field name.text
- The query text (to be analyzed).public static MatchPhrasePrefixQueryBuilder matchPhrasePrefixQuery(java.lang.String name, java.lang.Object text)
name
- The field name.text
- The query text (to be analyzed).public static DisMaxQueryBuilder disMaxQuery()
public static IdsQueryBuilder idsQuery()
public static IdsQueryBuilder idsQuery(java.lang.String... types)
types
- The mapping/doc typepublic static TermQueryBuilder termQuery(java.lang.String name, java.lang.String value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, int value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, long value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, float value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, double value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, boolean value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, java.lang.Object value)
name
- The name of the fieldvalue
- The value of the termpublic static FuzzyQueryBuilder fuzzyQuery(java.lang.String name, java.lang.String value)
name
- The name of the fieldvalue
- The value of the termmatchQuery(String, Object)
,
rangeQuery(String)
public static FuzzyQueryBuilder fuzzyQuery(java.lang.String name, java.lang.Object value)
name
- The name of the fieldvalue
- The value of the termmatchQuery(String, Object)
,
rangeQuery(String)
public static PrefixQueryBuilder prefixQuery(java.lang.String name, java.lang.String prefix)
name
- The name of the fieldprefix
- The prefix querypublic static RangeQueryBuilder rangeQuery(java.lang.String name)
name
- The field namepublic static WildcardQueryBuilder wildcardQuery(java.lang.String name, java.lang.String query)
name
- The field namequery
- The wildcard query stringpublic static RegexpQueryBuilder regexpQuery(java.lang.String name, java.lang.String regexp)
name
- The name of the fieldregexp
- The regular expressionpublic static QueryStringQueryBuilder queryStringQuery(java.lang.String queryString)
QueryStringQueryBuilder.field(String)
, will run the query once and non prefixed fields
will use the QueryStringQueryBuilder.defaultField(String)
set. The second, when one or more fields are added
(using QueryStringQueryBuilder.field(String)
), will run the parsed query against the provided fields, and combine
them either using DisMax or a plain boolean query (see QueryStringQueryBuilder.useDisMax(boolean)
).queryString
- The query string to runpublic static SimpleQueryStringBuilder simpleQueryStringQuery(java.lang.String queryString)
SimpleQueryParser
for the full
supported syntax.public static BoostingQueryBuilder boostingQuery(QueryBuilder positiveQuery, QueryBuilder negativeQuery)
public static BoolQueryBuilder boolQuery()
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, java.lang.String value)
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, int value)
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, long value)
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, float value)
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, double value)
public static SpanFirstQueryBuilder spanFirstQuery(SpanQueryBuilder match, int end)
public static SpanNearQueryBuilder spanNearQuery(SpanQueryBuilder initialClause, int slop)
public static SpanNotQueryBuilder spanNotQuery(SpanQueryBuilder include, SpanQueryBuilder exclude)
public static SpanOrQueryBuilder spanOrQuery(SpanQueryBuilder initialClause)
public static SpanWithinQueryBuilder spanWithinQuery(SpanQueryBuilder big, SpanQueryBuilder little)
span_within
builder.big
- the big clause, it must enclose little
for a match.little
- the little clause, it must be contained within big
for a match.public static SpanContainingQueryBuilder spanContainingQuery(SpanQueryBuilder big, SpanQueryBuilder little)
span_containing
builder.big
- the big clause, it must enclose little
for a match.little
- the little clause, it must be contained within big
for a match.public static SpanMultiTermQueryBuilder spanMultiTermQueryBuilder(MultiTermQueryBuilder multiTermQueryBuilder)
SpanQueryBuilder
which allows having a sub query
which implements MultiTermQueryBuilder
. This is useful for
having e.g. wildcard or fuzzy queries inside spans.multiTermQueryBuilder
- The MultiTermQueryBuilder
that
backs the created builder.public static FieldMaskingSpanQueryBuilder fieldMaskingSpanQuery(SpanQueryBuilder query, java.lang.String field)
public static ConstantScoreQueryBuilder constantScoreQuery(QueryBuilder queryBuilder)
queryBuilder
- The query to wrap in a constant score querypublic static FunctionScoreQueryBuilder functionScoreQuery(QueryBuilder queryBuilder)
queryBuilder
- The query to custom scorepublic static FunctionScoreQueryBuilder functionScoreQuery(QueryBuilder queryBuilder, FunctionScoreQueryBuilder.FilterFunctionBuilder[] filterFunctionBuilders)
queryBuilder
- The query to custom scorefilterFunctionBuilders
- the filters and functions to executepublic static FunctionScoreQueryBuilder functionScoreQuery(FunctionScoreQueryBuilder.FilterFunctionBuilder[] filterFunctionBuilders)
filterFunctionBuilders
- the filters and functions to executepublic static FunctionScoreQueryBuilder functionScoreQuery(ScoreFunctionBuilder function)
function
- The function builder used to custom scorepublic static FunctionScoreQueryBuilder functionScoreQuery(QueryBuilder queryBuilder, ScoreFunctionBuilder function)
queryBuilder
- The query to custom scorefunction
- The function builder used to custom scorepublic static MoreLikeThisQueryBuilder moreLikeThisQuery(java.lang.String[] fields, java.lang.String[] likeTexts, MoreLikeThisQueryBuilder.Item[] likeItems)
fields
- the field names that will be used when generating the 'More Like This' query.likeTexts
- the text to use when generating the 'More Like This' query.likeItems
- the documents to use when generating the 'More Like This' query.public static MoreLikeThisQueryBuilder moreLikeThisQuery(java.lang.String[] likeTexts, MoreLikeThisQueryBuilder.Item[] likeItems)
likeTexts
- the text to use when generating the 'More Like This' query.likeItems
- the documents to use when generating the 'More Like This' query.public static MoreLikeThisQueryBuilder moreLikeThisQuery(java.lang.String[] likeTexts)
likeTexts
- the text to use when generating the 'More Like This' query.public static MoreLikeThisQueryBuilder moreLikeThisQuery(MoreLikeThisQueryBuilder.Item[] likeItems)
likeItems
- the documents to use when generating the 'More Like This' query.public static NestedQueryBuilder nestedQuery(java.lang.String path, QueryBuilder query, org.apache.lucene.search.join.ScoreMode scoreMode)
public static TermsQueryBuilder termsQuery(java.lang.String name, java.lang.String... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, int... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, long... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, float... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, double... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, java.lang.Object... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, java.util.Collection<?> values)
name
- The field namevalues
- The terms@Deprecated public static IndicesQueryBuilder indicesQuery(QueryBuilder queryBuilder, java.lang.String... indices)
public static WrapperQueryBuilder wrapperQuery(java.lang.String source)
public static WrapperQueryBuilder wrapperQuery(BytesReference source)
public static WrapperQueryBuilder wrapperQuery(byte[] source)
public static TypeQueryBuilder typeQuery(java.lang.String type)
public static TermsQueryBuilder termsLookupQuery(java.lang.String name, TermsLookup termsLookup)
public static ScriptQueryBuilder scriptQuery(Script script)
script
- The script to filter by.public static GeoDistanceQueryBuilder geoDistanceQuery(java.lang.String name)
name
- The location field name.public static GeoDistanceRangeQueryBuilder geoDistanceRangeQuery(java.lang.String name, GeoPoint point)
name
- The location field name.point
- The pointpublic static GeoDistanceRangeQueryBuilder geoDistanceRangeQuery(java.lang.String name, java.lang.String geohash)
name
- The location field name.geohash
- The point as geohashpublic static GeoDistanceRangeQueryBuilder geoDistanceRangeQuery(java.lang.String name, double lat, double lon)
name
- The location field name.lat
- The points latitudelon
- The points longitudepublic static GeoBoundingBoxQueryBuilder geoBoundingBoxQuery(java.lang.String name)
name
- The location field name.public static GeohashCellQuery.Builder geoHashCellQuery(java.lang.String name, java.lang.String geohash)
{"type":"geo_point", "geohash":true}
to work.name
- The geo point field name.geohash
- The Geohash to filterpublic static GeohashCellQuery.Builder geoHashCellQuery(java.lang.String name, GeoPoint point)
{"type":"geo_point", "geohash":true}
to work.name
- The geo point field name.point
- a geo point within the geohash bucketpublic static GeohashCellQuery.Builder geoHashCellQuery(java.lang.String name, java.lang.String geohash, boolean neighbors)
{"type":"geo_point", "geohash":true}
to work.name
- The geo point field namegeohash
- The Geohash to filterneighbors
- should the neighbor cell also be filteredpublic static GeoPolygonQueryBuilder geoPolygonQuery(java.lang.String name, java.util.List<GeoPoint> points)
name
- The location field name.public static GeoShapeQueryBuilder geoShapeQuery(java.lang.String name, ShapeBuilder shape) throws java.io.IOException
name
- The shape field nameshape
- Shape to use in the filterjava.io.IOException
public static GeoShapeQueryBuilder geoShapeQuery(java.lang.String name, java.lang.String indexedShapeId, java.lang.String indexedShapeType)
public static GeoShapeQueryBuilder geoIntersectionQuery(java.lang.String name, ShapeBuilder shape) throws java.io.IOException
name
- The shape field nameshape
- Shape to use in the filterjava.io.IOException
public static GeoShapeQueryBuilder geoIntersectionQuery(java.lang.String name, java.lang.String indexedShapeId, java.lang.String indexedShapeType)
public static GeoShapeQueryBuilder geoWithinQuery(java.lang.String name, ShapeBuilder shape) throws java.io.IOException
name
- The shape field nameshape
- Shape to use in the filterjava.io.IOException
public static GeoShapeQueryBuilder geoWithinQuery(java.lang.String name, java.lang.String indexedShapeId, java.lang.String indexedShapeType)
public static GeoShapeQueryBuilder geoDisjointQuery(java.lang.String name, ShapeBuilder shape) throws java.io.IOException
name
- The shape field nameshape
- Shape to use in the filterjava.io.IOException
public static GeoShapeQueryBuilder geoDisjointQuery(java.lang.String name, java.lang.String indexedShapeId, java.lang.String indexedShapeType)
public static ExistsQueryBuilder existsQuery(java.lang.String name)
name
- The name of the field