From cc1415e281ade2bca894be77bd787718c31b7b48 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Tue, 26 Jul 2011 09:16:44 +0300 Subject: [PATCH] Add dfs test --- .../test/integration/nested/SimpleNestedTests.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/nested/SimpleNestedTests.java b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/nested/SimpleNestedTests.java index 7181bbfb5aa..ba8828e87a1 100644 --- a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/nested/SimpleNestedTests.java +++ b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/nested/SimpleNestedTests.java @@ -23,6 +23,7 @@ import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; import org.elasticsearch.action.delete.DeleteResponse; import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.action.search.SearchType; import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.search.facet.FacetBuilders; @@ -116,6 +117,10 @@ public class SimpleNestedTests extends AbstractNodesTests { assertThat(Arrays.toString(searchResponse.shardFailures()), searchResponse.failedShards(), equalTo(0)); assertThat(searchResponse.hits().totalHits(), equalTo(1l)); + searchResponse = client.prepareSearch("test").setQuery(nestedQuery("nested1", termQuery("nested1.n_field1", "n_value1_1"))).setSearchType(SearchType.DFS_QUERY_THEN_FETCH).execute().actionGet(); + assertThat(Arrays.toString(searchResponse.shardFailures()), searchResponse.failedShards(), equalTo(0)); + assertThat(searchResponse.hits().totalHits(), equalTo(1l)); + // add another doc, one that would match if it was not nested... client.prepareIndex("test", "type1", "2").setSource(jsonBuilder().startObject()