Hello,
I have a problem with searching from document contets. I 've been using Elasticsearch 1.7.3, but now I want to start using the most newest version (2.2.1). I installed new version of ES, installed mapper-attachments plugin. No errors, service started and all feels ok.
I made little mapping to test it out.
PUT test_index
{
"settings": {
"number_of_shards": 2,
"number_of_replicas": 0
},
"mappings": {
"testfile": {
"dynamic": "strict",
"_source": {
"enabled": true
},
"properties": {
"fileId": {
"type": "integer",
"store": true
},
"contents": {
"type": "attachment"
}
}
}
}
}
After indexing the document with contents "hello world" and making match_all query the results looks like this:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 2,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "test_index",
"_type": "testfile",
"_id": "AVO3TKC2-BSsruK6CY8T",
"_score": 1,
"_source": {
"fileId": 101,
"contents": "aGVsbG8gd29ybGQ="
}
}
]
}
}
If I'll try to search word "hello" with phrase search, it doesn't work. No results are returned. The phrase search looks like this:
POST test_index/_search
{
"from": 0,
"size": 1000,
"fields": [
"fileId"
],
"query": {
"bool": {
"must": [
{
"match": {
"contents": {
"query": "hello",
"type": "phrase"
}
}
}
]
}
}
}
Previous versions of ES and mapper-attachments worked fine. Also there's no errors in log. Can someone help me to figure it out?
Thanks in advance!