Examples of hits()


Examples of org.elasticsearch.action.search.SearchResponse.hits()

                .execute().actionGet();

        assertThat(searchResponse.hits().getTotalHits(), equalTo(7l));
        assertThat(searchResponse.hits().hits().length, equalTo(7));
        assertThat(searchResponse.hits().getAt(6).id(), equalTo("1"));
        assertThat(searchResponse.hits().getAt(5).id(), equalTo("3"));
        assertThat(searchResponse.hits().getAt(4).id(), equalTo("4"));
        assertThat(searchResponse.hits().getAt(3).id(), equalTo("5"));
        assertThat(searchResponse.hits().getAt(2).id(), equalTo("6"));
        assertThat(searchResponse.hits().getAt(1).id(), equalTo("2"));
        assertThat(searchResponse.hits().getAt(0).id(), equalTo("7"));
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.hits()

        assertThat(searchResponse.hits().getTotalHits(), equalTo(7l));
        assertThat(searchResponse.hits().hits().length, equalTo(7));
        assertThat(searchResponse.hits().getAt(6).id(), equalTo("1"));
        assertThat(searchResponse.hits().getAt(5).id(), equalTo("3"));
        assertThat(searchResponse.hits().getAt(4).id(), equalTo("4"));
        assertThat(searchResponse.hits().getAt(3).id(), equalTo("5"));
        assertThat(searchResponse.hits().getAt(2).id(), equalTo("6"));
        assertThat(searchResponse.hits().getAt(1).id(), equalTo("2"));
        assertThat(searchResponse.hits().getAt(0).id(), equalTo("7"));
    }
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.hits()

        assertThat(searchResponse.hits().getTotalHits(), equalTo(7l));
        assertThat(searchResponse.hits().hits().length, equalTo(7));
        assertThat(searchResponse.hits().getAt(6).id(), equalTo("1"));
        assertThat(searchResponse.hits().getAt(5).id(), equalTo("3"));
        assertThat(searchResponse.hits().getAt(4).id(), equalTo("4"));
        assertThat(searchResponse.hits().getAt(3).id(), equalTo("5"));
        assertThat(searchResponse.hits().getAt(2).id(), equalTo("6"));
        assertThat(searchResponse.hits().getAt(1).id(), equalTo("2"));
        assertThat(searchResponse.hits().getAt(0).id(), equalTo("7"));
    }
}
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.hits()

        assertThat(searchResponse.hits().hits().length, equalTo(7));
        assertThat(searchResponse.hits().getAt(6).id(), equalTo("1"));
        assertThat(searchResponse.hits().getAt(5).id(), equalTo("3"));
        assertThat(searchResponse.hits().getAt(4).id(), equalTo("4"));
        assertThat(searchResponse.hits().getAt(3).id(), equalTo("5"));
        assertThat(searchResponse.hits().getAt(2).id(), equalTo("6"));
        assertThat(searchResponse.hits().getAt(1).id(), equalTo("2"));
        assertThat(searchResponse.hits().getAt(0).id(), equalTo("7"));
    }
}
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.hits()

        assertThat(searchResponse.hits().getAt(6).id(), equalTo("1"));
        assertThat(searchResponse.hits().getAt(5).id(), equalTo("3"));
        assertThat(searchResponse.hits().getAt(4).id(), equalTo("4"));
        assertThat(searchResponse.hits().getAt(3).id(), equalTo("5"));
        assertThat(searchResponse.hits().getAt(2).id(), equalTo("6"));
        assertThat(searchResponse.hits().getAt(1).id(), equalTo("2"));
        assertThat(searchResponse.hits().getAt(0).id(), equalTo("7"));
    }
}
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.hits()

        assertThat(searchResponse.hits().getAt(5).id(), equalTo("3"));
        assertThat(searchResponse.hits().getAt(4).id(), equalTo("4"));
        assertThat(searchResponse.hits().getAt(3).id(), equalTo("5"));
        assertThat(searchResponse.hits().getAt(2).id(), equalTo("6"));
        assertThat(searchResponse.hits().getAt(1).id(), equalTo("2"));
        assertThat(searchResponse.hits().getAt(0).id(), equalTo("7"));
    }
}
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.hits()

        client.admin().indices().prepareRefresh().execute().actionGet();

        SearchResponse searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoBoundingBoxFilter("location").topLeft(40.73, -74.1).bottomRight(40.717, -73.99)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(2l));
        assertThat(searchResponse.hits().hits().length, equalTo(2));
        for (SearchHit hit : searchResponse.hits()) {
            System.err.println("-->" + hit.id());
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("5")));
        }
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.hits()

        SearchResponse searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoBoundingBoxFilter("location").topLeft(40.73, -74.1).bottomRight(40.717, -73.99)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(2l));
        assertThat(searchResponse.hits().hits().length, equalTo(2));
        for (SearchHit hit : searchResponse.hits()) {
            System.err.println("-->" + hit.id());
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("5")));
        }
    }
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.hits()

        SearchResponse searchResponse = client.prepareSearch() // from NY
                .setQuery(filteredQuery(matchAllQuery(), geoBoundingBoxFilter("location").topLeft(40.73, -74.1).bottomRight(40.717, -73.99)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(2l));
        assertThat(searchResponse.hits().hits().length, equalTo(2));
        for (SearchHit hit : searchResponse.hits()) {
            System.err.println("-->" + hit.id());
            assertThat(hit.id(), anyOf(equalTo("1"), equalTo("3"), equalTo("5")));
        }
    }
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.hits()

        client.admin().indices().prepareRefresh().execute().actionGet();

        SearchResponse searchResponse = client.prepareSearch()
                .setQuery(filteredQuery(matchAllQuery(), geoBoundingBoxFilter("location").topLeft(41, -11).bottomRight(40, 9)))
                .execute().actionGet();
        assertThat(searchResponse.hits().getTotalHits(), equalTo(1l));
        assertThat(searchResponse.hits().hits().length, equalTo(1));
        assertThat(searchResponse.hits().getAt(0).id(), equalTo("2"));

        searchResponse = client.prepareSearch()
                .setQuery(filteredQuery(matchAllQuery(), geoBoundingBoxFilter("location").topLeft(41, -9).bottomRight(40, 11)))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.