|
@@ -24,6 +24,7 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasA
|
|
|
import org.elasticsearch.action.search.SearchRequest;
|
|
|
import org.elasticsearch.action.support.IndicesOptions;
|
|
|
import org.elasticsearch.index.IndexNotFoundException;
|
|
|
+import org.elasticsearch.index.mapper.MapperService;
|
|
|
import org.elasticsearch.index.query.MatchAllQueryBuilder;
|
|
|
import org.elasticsearch.index.query.QueryBuilders;
|
|
|
import org.elasticsearch.index.rankeval.PrecisionAtK.Detail;
|
|
@@ -65,16 +66,22 @@ public class RankEvalRequestIT extends ESIntegTestCase {
|
|
|
createIndex(TEST_INDEX);
|
|
|
ensureGreen();
|
|
|
|
|
|
- client().prepareIndex(TEST_INDEX, "testtype").setId("1")
|
|
|
+ client().prepareIndex(TEST_INDEX, MapperService.SINGLE_MAPPING_NAME).setId("1")
|
|
|
.setSource("text", "berlin", "title", "Berlin, Germany", "population", 3670622).get();
|
|
|
- client().prepareIndex(TEST_INDEX, "testtype").setId("2").setSource("text", "amsterdam", "population", 851573).get();
|
|
|
- client().prepareIndex(TEST_INDEX, "testtype").setId("3").setSource("text", "amsterdam", "population", 851573).get();
|
|
|
- client().prepareIndex(TEST_INDEX, "testtype").setId("4").setSource("text", "amsterdam", "population", 851573).get();
|
|
|
- client().prepareIndex(TEST_INDEX, "testtype").setId("5").setSource("text", "amsterdam", "population", 851573).get();
|
|
|
- client().prepareIndex(TEST_INDEX, "testtype").setId("6").setSource("text", "amsterdam", "population", 851573).get();
|
|
|
+ client().prepareIndex(TEST_INDEX, MapperService.SINGLE_MAPPING_NAME).setId("2").setSource("text", "amsterdam", "population", 851573)
|
|
|
+ .get();
|
|
|
+ client().prepareIndex(TEST_INDEX, MapperService.SINGLE_MAPPING_NAME).setId("3").setSource("text", "amsterdam", "population", 851573)
|
|
|
+ .get();
|
|
|
+ client().prepareIndex(TEST_INDEX, MapperService.SINGLE_MAPPING_NAME).setId("4").setSource("text", "amsterdam", "population", 851573)
|
|
|
+ .get();
|
|
|
+ client().prepareIndex(TEST_INDEX, MapperService.SINGLE_MAPPING_NAME).setId("5").setSource("text", "amsterdam", "population", 851573)
|
|
|
+ .get();
|
|
|
+ client().prepareIndex(TEST_INDEX, MapperService.SINGLE_MAPPING_NAME).setId("6").setSource("text", "amsterdam", "population", 851573)
|
|
|
+ .get();
|
|
|
|
|
|
// add another index for testing closed indices etc...
|
|
|
- client().prepareIndex("test2", "testtype").setId("7").setSource("text", "amsterdam", "population", 851573).get();
|
|
|
+ client().prepareIndex("test2", MapperService.SINGLE_MAPPING_NAME).setId("7").setSource("text", "amsterdam", "population", 851573)
|
|
|
+ .get();
|
|
|
refresh();
|
|
|
|
|
|
// set up an alias that can also be used in tests
|