Elasticsearch 之 条件查询

一、参考网址:

https://zhuanlan.zhihu.com/p/95163799

二、参考语法描述

Parameters: 
index – A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices
doc_type – A comma-separated list of document types to search; leave empty to perform the operation on all types
body – The search definition using the Query DSL
_source – True or false to return the _source field or not, or a list of fields to return
_source_exclude – A list of fields to exclude from the returned _source field
_source_include – A list of fields to extract and return from the _source field
_source_excludes – A list of fields to exclude from the returned _source field
_source_includes – A list of fields to extract and return from the _source field
allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
allow_partial_search_results – Set to false to return an overall failure if the request would produce partial results. Defaults to True, which will allow partial results in the case of timeouts or partial failures
analyze_wildcard – Specify whether wildcard and prefix queries should be analyzed (default: false)
analyzer – The analyzer to use for the query string
batched_reduce_size – The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large., default 512
default_operator – The default operator for query string query (AND or OR), default ‘OR’, valid choices are: ‘AND’, ‘OR’
df – The field to use as default where no field prefix is given in the query string
docvalue_fields – A comma-separated list of fields to return as the docvalue representation of a field for each hit
expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both., default ‘open’, valid choices are: ‘open’, ‘closed’, ‘none’, ‘all’
explain – Specify whether to return detailed information about score computation as part of a hit
from_ – Starting offset (default: 0)
ignore_throttled – Whether specified concrete, expanded or aliased indices should be ignored when throttled
ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
lenient – Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
max_concurrent_shard_requests – The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests, default ‘The default grows with the number of nodes in the cluster but is at most 256.’
pre_filter_shard_size – A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it’s rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint., default 128
preference – Specify the node or shard the operation should be performed on (default: random)
q – Query in the Lucene query string syntax
request_cache – Specify if request cache should be used for this request or not, defaults to index level setting
rest_total_hits_as_int – This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number, default False
routing – A comma-separated list of specific routing values
scroll – Specify how long a consistent view of the index should be maintained for scrolled search
search_type – Search operation type, valid choices are: ‘query_then_fetch’, ‘dfs_query_then_fetch’
seq_no_primary_term – Specify whether to return sequence number and primary term of the last modification of each hit
size – Number of hits to return (default: 10)
sort – A comma-separated list of <field>:<direction> pairs
stats – Specific ‘tag’ of the request for logging and statistical purposes
stored_fields – A comma-separated list of stored fields to return as part of a hit
suggest_field – Specify which field to use for suggestions
suggest_mode – Specify suggest mode, default ‘missing’, valid choices are: ‘missing’, ‘popular’, ‘always’
suggest_size – How many suggestions to return in response
suggest_text – The source text for which the suggestions should be returned
terminate_after – The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
timeout – Explicit operation timeout
track_scores – Whether to calculate and return scores even if they are not used for sorting
track_total_hits – Indicate if the number of documents that match the query should be tracked
typed_keys – Specify whether aggregation and suggester names should be prefixed by their respective types in the response
version – Specify whether to return document version as part of a hit

猜你喜欢

转载自blog.51cto.com/12965094/2664674