10 query string, X field must contain (not included) XX; _all principle

  1. Specify a field must contain XX characters
    GET /beauties/my/_search?q=Name:Chang Wei
     
  1. The seizure of a field that does not contain XX characters of all content
    GET / beauties / my / _search q = -Name:? Ruru (search results, Name not included Ruru)
     
  2. No matter which field, just contains the specified character, you can return
    GET /beauties/my/_search?q=Ruru
    Principle: Internal ES, not to see what each field is not included Ruru, but a special search field: _all.
 
 
_all principle :
ES when a record is inserted, will automatically generate a _all field, it will all
 
ES inserted in a document, it contains a plurality of field. At this time, automatically ES plurality of field values, in series with all of the character string, the character string into a long, as _all field values ​​while index
 
If you later when searching, not for a specified search field, then the default search field _all , which is containing all the values of the field
 
for example
 
{
  "name": "jack",
  "age": 26,
  "email": " [email protected]",
  "address": "guamgzhou"
}
 
"Jack 26 [email protected] establish corresponding inverted index after guangzhou", as the value of this _all field of a document, at the same time word
 
 

Guess you like

Origin www.cnblogs.com/cc299/p/11032824.html