-
Notifications
You must be signed in to change notification settings - Fork 25.5k
review term-query examples #114519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
review term-query examples #114519
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -38,6 +38,7 @@ GET /_search | |||||
} | ||||||
} | ||||||
---- | ||||||
// REVIEWED[10.10.24] | ||||||
|
||||||
[[term-top-level-params]] | ||||||
==== Top-level parameters for `term` | ||||||
|
@@ -106,7 +107,7 @@ PUT my-index-000001 | |||||
} | ||||||
} | ||||||
---- | ||||||
|
||||||
// REVIEWED[10.10.24] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
-- | ||||||
|
||||||
. Index a document with a value of `Quick Brown Foxes!` in the `full_text` | ||||||
|
@@ -122,7 +123,7 @@ PUT my-index-000001/_doc/1 | |||||
} | ||||||
---- | ||||||
// TEST[continued] | ||||||
|
||||||
// REVIEWED[10.10.24] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Because `full_text` is a `text` field, {es} changes `Quick Brown Foxes!` to | ||||||
`[quick, brown, fox]` during analysis. | ||||||
|
||||||
|
@@ -145,7 +146,7 @@ GET my-index-000001/_search?pretty | |||||
} | ||||||
---- | ||||||
// TEST[continued] | ||||||
|
||||||
// REVIEWED[10.10.24] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Because the `full_text` field no longer contains the *exact* term `Quick Brown | ||||||
Foxes!`, the `term` query search returns no results. | ||||||
|
||||||
|
@@ -163,7 +164,7 @@ field. | |||||
POST my-index-000001/_refresh | ||||||
---- | ||||||
// TEST[continued] | ||||||
|
||||||
// REVIEWED[10.10.24] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//// | ||||||
|
||||||
[source,console] | ||||||
|
@@ -178,7 +179,7 @@ GET my-index-000001/_search?pretty | |||||
} | ||||||
---- | ||||||
// TEST[continued] | ||||||
|
||||||
// REVIEWED[10.10.24] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Unlike the `term` query, the `match` query analyzes your provided search term, | ||||||
`Quick Brown Foxes!`, before performing a search. The `match` query then returns | ||||||
any documents containing the `quick`, `brown`, or `fox` tokens in the | ||||||
|
@@ -219,3 +220,4 @@ in the results. | |||||
---- | ||||||
// TESTRESPONSE[s/"took" : 1/"took" : $body.took/] | ||||||
-- | ||||||
// REVIEWED[10.10.24] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way, it'll be unambiguous.