Could someone please try and point out what I am missing / doing wrong?
My environment details:
Java 1.8.0u45
ElasticSearch 2.1.0
ElasticSearch Mapper Attachments 3.1.0
Here is a snippet from when I start up ES - mapper-attachments loaded:
[2016-04-27 12:31:14,849][INFO ][node ] [Trevor Fitzroy] version[2.1.0], pid[3978], build[72cd1f1/2015-11-18T22:40:03Z]
[2016-04-27 12:31:14,851][INFO ][node ] [Trevor Fitzroy] initializing ...
[2016-04-27 12:31:16,358][INFO ][plugins ] [Trevor Fitzroy] loaded [mapper-attachments], sites []
[2016-04-27 12:31:16,453][INFO ][env ] [Trevor Fitzroy] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [59.9gb], net total_space [111.8gb], spins? [unknown], types [hfs]
[2016-04-27 12:31:22,901][INFO ][node ] [Trevor Fitzroy] initialized
[2016-04-27 12:31:22,902][INFO ][node ] [Trevor Fitzroy] starting ...
[2016-04-27 12:31:23,157][INFO ][transport ] [Trevor Fitzroy] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[fe80::1]:9300}, {[::1]:9300}
Here is the mapping I've created:
{
"settings": {
"number_of_shards": 1
},
"mappings": {
"document": {
"properties": {
"tags": {
"analyzer": "snowball",
"type": "string"
},
"rank": {
"analyzer": "keyword",
"type": "string"
},
"upload_date": {
"analyzer": "keyword",
"type": "string"
},
"document_contents": {
"type": "attachment"
}
}
}
}
}
The document contents is the following ( testing.txt ):
I am testing the mapper plugin lets see ..
Here is my put request:
{
"id": 9,
"tags": "order, april, testing",
"rank": 1,
"upload_date": "2016-04-27T02:18:23.974Z",
"document_contents": {
"_indexed_chars": -1,
"_content": "SSBhbSB0ZXN0aW5nIHRoZSBtYXBwZXIgcGx1Z2luIGxldHMgc2VlIC4uCg==\n"
}
}
And finally my query:
{
"query": {
"filtered": {
"query": {
"match": {
"document_contents.content": "testing"
}
},
"filter": {
"range": {
"rank": {
"gte": "1"
}
}
}
}
},
"sort": [{
"upload_date": {
"order": "desc"
}
}]
}
Here is the Mapper Attachments doc using 'query match' to search the document contents:
Any help is much appreciated.
Thank you.