Hi all,
I try to make some tests but unsuccessful.
I try to create an test index:
curl -XPUT localhost:9200/test -d@index_template_test.txt
index-template-test.txt file:
{ "settings" : { "analysis": { "tokenizer": { "custom-pattern-tokenizer": { "type": "pattern", "pattern": "." } }, "analyzer": { "custom-analyzer": { "type": "custom", "tokenizer": "custom-pattern-tokenizer" } } } }, "mappings": { "my_type": { "properties": { "source_host": { "type": "string", "index": "analyzed", "analyzer": "custom-analyzer" } } } } }
After, I put data:
curl -XPUT localhost:9200/test/my_type/1 -d' { "source_host" : "mytest-test-1.fr" }'
When I made a global search, I get an answer:
curl -XGET localhost:9200/test/_search?pretty { "took" : 3, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 }, "hits" : { "total" : 1, "max_score" : 1.0, "hits" : [ { "_index" : "test", "_type" : "my_type", "_id" : "1", "_score" : 1.0, "_source" : { "source_host" : "mytest-test-1.fr" } } ] } }
But when I make a specific search, it returns nothing:
curl -XGET localhost:9200/test/my_type/_search?pretty=true -d' { "query": { "match": { "source_host" : "mytest-test-1.fr" } } }' { "took" : 1, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 }, "hits" : { "total" : 0, "max_score" : null, "hits" : [ ] } }
So I can't make some test with _analyze right now. Do you have any idea why I can't return a result with this kind of search ?
Result when I try an _analyze:
curl -XGET 'localhost:9200/test/_analyze?pretty&analyzer=custom-analyzer' -d mytest-test-1.fr { "tokens" : [ ] }
Thanks in advance,
Alex