summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java
diff options
context:
space:
mode:
authorBoaz Leskes <b.leskes@gmail.com>2016-01-24 22:47:38 +0100
committerBoaz Leskes <b.leskes@gmail.com>2016-01-28 08:40:10 +0100
commit2a137b554825a5f848cfaff6311d7c298fd76fe7 (patch)
treefb78f310d01f855d9ae4fb4951c21332882f6d25 /core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java
parent8c5171fac85b940948cc543c3a4686ef1f173cd3 (diff)
Make index uuid available in Index, ShardRouting & ShardId
In the early days Elasticsearch used to use the index name as the index identity. Around 1.0.0 we introduced a unique index uuid which is stored in the index setting. Since then we used that uuid in a few places but it is by far not the main identifier when working with indices, partially because it's not always readily available in all places. This PR start to make a move in the direction of using uuids instead of name by making sure that the uuid is available on the Index class (currently just a wrapper around the name) and as such also available via ShardRouting and ShardId. Note that this is by no means an attempt to do the right thing with the uuid in all places. In almost all places it falls back to the name based comparison that was done before. It is meant as a first step towards slowly improving the situation. Closes #16217
Diffstat (limited to 'core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java')
-rw-r--r--core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java b/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java
index 1305aa727f..01f7e33244 100644
--- a/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java
+++ b/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java
@@ -35,7 +35,6 @@ import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType;
-import org.elasticsearch.index.Index;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.mapper.ContentPath;
import org.elasticsearch.index.mapper.MappedFieldType;
@@ -159,8 +158,7 @@ public class QueryRescoreBuilderTests extends ESTestCase {
public void testBuildRescoreSearchContext() throws ElasticsearchParseException, IOException {
Settings indexSettings = Settings.settingsBuilder()
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build();
- Index index = new Index(randomAsciiOfLengthBetween(1, 10));
- IndexSettings idxSettings = IndexSettingsModule.newIndexSettings(index, indexSettings);
+ IndexSettings idxSettings = IndexSettingsModule.newIndexSettings(randomAsciiOfLengthBetween(1, 10), indexSettings);
// shard context will only need indicesQueriesRegistry for building Query objects nested in query rescorer
QueryShardContext mockShardContext = new QueryShardContext(idxSettings, null, null, null, null, null, null, indicesQueriesRegistry) {
@Override