Hi there,
I am trying to add exact matching functionality in my app, but I found some issues.
I created an index exactmatching_v4 in my Elasticsearch cluster ( version 1.7 ) with following mappings:
POST /exactmatching_v4
{
"aliases": {},
"mappings": {
"document": {
"properties": {
"content": {
"type": "string",
"index": "not_analyzed"
},
"lang": {
"type": "string",
"index": "not_analyzed"
},
"path": {
"type": "string"
}
}
}
}
}
And I added the following documents
PUT /exactmatching/document/1
{
"content": "do test",
"lang": "en",
"path": "/1"
}
PUT /exactmatching/document/2
{
"content": "the test has been done",
"lang": "en",
"path": "/2"
}
PUT /exactmatching/document/3
{
"content": "give me some tests",
"lang": "en",
"path": "/3"
}
PUT /exactmatching/document/4
{
"content": "different one",
"lang": "en",
"path": "/4"
}
The goal is to make a search that will find to me the docs containing the exact sentence some tests
At the first time, I had to find all docs containing the word test using query_string, but it doesn't give any thing.
{
"query": {
"query_string": {
"fields": [
"content"
],
"query": "test",
"analyze_wildcard": true
}
}
}
Please not that I added "analyze_wildcard": true by following a solution proposed in the following issue.
Thank you all.