You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 21, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: 080_Structured_Search/30_existsmissing.asciidoc
+15-15
Original file line number
Diff line number
Diff line change
@@ -17,18 +17,18 @@ look at that inverted index from the previous section:
17
17
18
18
How would you store a field that doesn't exist in that data structure? You
19
19
can't! An inverted index is simply a list of tokens and the documents that
20
-
contain them. If a field doesn't exist... it doesn't hold any tokens, which
20
+
contain them. If a field doesn't exist, it doesn't hold any tokens, which
21
21
means it won't be represented in an inverted index data structure.
22
22
23
23
Ultimately, this((("strings", "empty")))((("arrays", "empty"))) means that a `null`, `""` (an empty string), `[]` (an empty
24
-
array), and `[null]` are all equivalent... they simply don't exist in the
24
+
array), and `[null]` are all equivalent. They simply don't exist in the
25
25
inverted index!
26
26
27
-
Obviously the world is not simple, and data is often missing fields, contains
27
+
Obviously, the world is not simple, and data is often missing fields, or contains
28
28
explicit nulls or empty arrays. To deal with these situations, Elasticsearch has
29
29
a few tools to work with null or missing values.
30
30
31
-
==== Exists Filter
31
+
==== exists Filter
32
32
33
33
The first tool in your arsenal is the `exists` filter.((("null values", "working with, using exists filter")))((("exists filter"))) This filter will return
34
34
documents that have any value in the specified field. Let's use the tagging example
@@ -117,17 +117,17 @@ Our query returns three documents:
<1> Doc `5` is returned even though it contains a `null` value. The field
121
-
exists because a realvalue tag was indexed, so the `null` had no impact
120
+
<1> Document 5 is returned even though it contains a `null` value. The field
121
+
exists because a real-value tag was indexed, so the `null` had no impact
122
122
on the filter.
123
123
124
-
The results are easy to understand. Any document that has actual terms in the
124
+
The results are easy to understand. Any document that has terms in the
125
125
`tags` field was returned as a hit. The only two documents that were excluded
126
-
were documents `3` and `4`.
126
+
were documents 3 and 4.
127
127
128
-
==== Missing Filter
128
+
==== missing Filter
129
129
130
-
The `missing` filter is essentially((("null values", "working with, using missing filter")))((("missing filter"))) the inverse of the `exists`: it returns
130
+
The `missing` filter is essentially((("null values", "working with, using missing filter")))((("missing filter"))) the inverse of `exists`: it returns
131
131
documents where there is _no_ value for a particular field, much like this
0 commit comments