I run one node with ElasticSearch (1.4.4), and I have two indexes with the same documents indexed. The only difference is the number of fragments:
- Index 1: 5 shards, 0 replicas
- Index 2: 1 Shard, 0 Replicas
When I run a test of 100 different queries using the Java API, I get different results for each index. I tried using DFS Query Then Fetch for both of them, but still get different results.
I wonder what is going on. I'm not sure how elasticsearch executes queries to get different results.
UPDATE:
These are the settings and mappings for my indices:
"settings": { "number_of_shards" : 1, // or 5 for the other index "number_of_replicas" : 0, "analysis": { "filter": { "worddelimiter": { "type": "word_delimiter" } }, "analyzer": { "custom_analyzer": { "type": "custom", "filter": [ "lowercase", "asciifolding", "worddelimiter" ], "tokenizer": "standard" } } } } "mappings": { "faq": { "properties": { "answer": { "type": "string", "analyzer": "custom_analyzer" }, "answer_id": { "type": "long" }, "path": { "type": "string", "analyzer": "custom_analyzer" }, "question": { "type": "string", "analyzer": "custom_analyzer" } } } }
And this is the request:
client.prepareSearch(index) .setTypes(type) .setSearchType(SearchType.DFS_QUERY_THEN_FETCH) .setQuery(QueryBuilders.multiMatchQuery(inputText, "questions","answer^2","paths") .setSize(BUFFER_SIZE) .setFrom(i * BUFFER_SIZE) .execute() .actionGet();
elasticsearch
Gabriel tena
source share