, , , , , Standard Analyzer, , not_analyzed.
, API Elasticsearch
curl -XPOST "http://localhost:9200/_analyze?analyzer=standard&text=ter%40gmail.com
url, @. :
{
"tokens": [
{
"token": "ter",
"start_offset": 0,
"end_offset": 3,
"type": "<ALPHANUM>",
"position": 1
},
{
"token": "gmail.com",
"start_offset": 4,
"end_offset": 13,
"type": "<ALPHANUM>",
"position": 2
}
]
}
, , ter gmail.com, , .
, , , , .
boolean , , , .
text ter@gmail.com, , , ter gmail.com ,
// Indexing
input: ter@gmail.com -> standard analyzer -> ter,gmail.com in inverted index
// Querying
input: ter@gmail.com -> match query -> docs with ter or gmail.com are a hit!
, , !
Term , , .. , , , ; , , , , .
// Indexing
input: ter@gmail.com -> standard analyzer -> ter,gmail.com in inverted index
// Querying
input: ter@gmail.com -> term query -> No exact matches for ter@gmail.com
input: ter -> term query -> docs with ter in inverted index are a hit!
, !
, , , , not_analyzed
putMappingDescriptor
.MapFromAttributes()
.Properties(p => p
.String(s => s.Name(n => n.FieldName).Index(FieldIndexOption.NotAnalyzed)
);
Term filter
var docs = client.Search<dynamic>(b => b
.Query(q => q
.Filtered(fq => fq
.Filter(f => f
.Term("fieldName", "ter@gmail.com")
)
)
)
);
DSL
{
"query": {
"filtered": {
"filter": {
"term": {
"fieldName": "ter@gmail.com"
}
}
}
}
}