Skip to content

Commit 22af392

Browse files
refactormyselfChristoph Büscher
authored andcommitted
[Docs] Add definitions to glossary (#29127)
Definitions for "filter" and "query" are added to the glossary of terms. Closes #29127
1 parent 2091fc3 commit 22af392

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

docs/reference/glossary.asciidoc

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@
6161
`object`. The mapping also allows you to define (amongst other things)
6262
how the value for a field should be analyzed.
6363

64+
[[glossary-filter]] filter ::
65+
66+
A filter is a non-scoring <<glossary-query,query>>, meaning that it does not score documents.
67+
It is only concerned about answering the question - "Does this document match?".
68+
The answer is always a simple, binary yes or no. This kind of query is said to be made
69+
in a <<query-filter-context,filter context>>,
70+
hence it is called a filter. Filters are simple checks for set inclusion or exclusion.
71+
In most cases, the goal of filtering is to reduce the number of documents that have to be examined.
72+
6473
[[glossary-index]] index ::
6574

6675
An index is like a _table_ in a relational database. It has a
@@ -105,6 +114,16 @@
105114
+
106115
See also <<glossary-routing,routing>>
107116

117+
[[glossary-query]] query ::
118+
119+
A query is the basic component of a search. A search can be defined by one or more queries
120+
which can be mixed and matched in endless combinations. While <<glossary-filter,filters>> are
121+
queries that only determine if a document matches, those queries that also calculate how well
122+
the document matches are known as "scoring queries". Those queries assign it a score, which is
123+
later used to sort matched documents. Scoring queries take more resources than <<glossary-filter,non scoring queries>>
124+
and their query results are not cacheable. As a general rule, use query clauses for full-text
125+
search or for any condition that requires scoring, and use filters for everything else.
126+
108127
[[glossary-replica-shard]] replica shard ::
109128

110129
Each <<glossary-primary-shard,primary shard>> can have zero or more
@@ -161,8 +180,9 @@
161180

162181
A term is an exact value that is indexed in Elasticsearch. The terms
163182
`foo`, `Foo`, `FOO` are NOT equivalent. Terms (i.e. exact values) can
164-
be searched for using _term_ queries. +
165-
See also <<glossary-text,text>> and <<glossary-analysis,analysis>>.
183+
be searched for using _term_ queries.
184+
+
185+
See also <<glossary-text,text>> and <<glossary-analysis,analysis>>.
166186

167187
[[glossary-text]] text ::
168188

0 commit comments

Comments
 (0)