-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquries.txt
82 lines (64 loc) · 1.47 KB
/
quries.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
GET /my_index/my_type/_search
{
"query": {
"match": {
"title": "BROWN DOG!"
}
}
}
GET /my_index/my_type/_search
{
"query": {
"match": {
"title": {
"query": "quick brown dog",
"minimum_should_match": "75%"
}
}
}
}
Bool condition
GET /my_index/my_type/_search
{
"query": {
"bool": {
"should": [
{ "match": { "title": "brown" }},
{ "match": { "title": "fox" }},
{ "match": { "title": "dog" }}
],
"minimum_should_match": 2
}
}
}
The index_analyzer defined in the field mapping, else
The search_analyzer defined in the field mapping
The first is to create an index with one primary shard, as we did in the section introducing the match query. If you have only one shard, then the local IDF is the global IDF.
These analyzers typically perform four roles:
Tokenize text into individual words:
The quick brown foxes ? [The, quick, brown, foxes]
Lowercase tokens:
The ? the
Remove common stopwords:
[The, quick, brown, foxes] ? [quick, brown, foxes]
Stem tokens to their root form:
foxes ? fox
The english analyzer removes the possessive 's:
John's ? john
{
"type": "custom",
"tokenizer": "standard",
"filter": [ "lowercase", "stop" ]
}
GET /my_index/my_type/_search
{
"query": {
"match": {
"text": {
"query": "SURPRIZE ME!",
"fuzziness": "AUTO",
"operator": "and"
}
}
}
}