Key points of knowledge
1 , query string Basic Syntax
2 , _all Metadata the Understanding
First,query string Basic syntax
1 , get/test_index/test_type/_search?q=test_field:test
Enquiry Test_field This field (field) contains all the data for the keyword test.
2 , get/test_index/test_type/_search?q=+test_field:test
" + "means that you must include the following keywords Test , actually add this " + "The numbers are all the same.
3 , get/test_index/test_type/_search?q=-test_field:test
" - "means that you must not include the following keywords . Test .
The principle and function of _all metadata
Get/test_index/test_type/_search?q=test
You can use this syntax to search directly for all Field , any one Field contains the specified keyword to search for. This syntax uses the principle of _all metadata .
When the es is indexed, when we insert aDocument, it contains a number ofField, at this point,esWill automatically add multipleFieldvalues, all concatenated together in string form, into a long string, as_all Fieldand then creates an inverted index after the word breaker. If the search is not specified for a particularFieldSearch , the default search_all Fieldvalue that contains all of theFieldthe value.
For example, suppose there is a Document the values are as follows:
{
"Name": "Jack",
"Age": 26,
"Email": "[email protected]",
"Address": "Guamgzhou"
}
es in the _all Metadata the value is "Jack protected [email] guangzhou" , and the corresponding inverted index is established after the string is participle.
37.query string, _all metadata