本文整理匯總了Java中org.elasticsearch.search.SearchHits.getAt方法的典型用法代碼示例。如果您正苦於以下問題:Java SearchHits.getAt方法的具體用法?Java SearchHits.getAt怎麽用?Java SearchHits.getAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.elasticsearch.search.SearchHits
的用法示例。
在下文中一共展示了SearchHits.getAt方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: filterPolygonTest
import org.elasticsearch.search.SearchHits; //導入方法依賴的package包/類
@Test
public void filterPolygonTest() throws SQLFeatureNotSupportedException, SqlParseException, InterruptedException {
SearchHits results = query(String.format("SELECT * FROM %s/location WHERE GEO_INTERSECTS(place,'POLYGON ((102 2, 103 2, 103 3, 102 3, 102 2))')", TEST_INDEX));
org.junit.Assert.assertEquals(1,results.getTotalHits());
SearchHit result = results.getAt(0);
Assert.assertEquals("bigSquare",result.getSource().get("description"));
}
示例2: boundingBox
import org.elasticsearch.search.SearchHits; //導入方法依賴的package包/類
@Test
public void boundingBox() throws SQLFeatureNotSupportedException, SqlParseException, InterruptedException {
SearchHits results = query(String.format("SELECT * FROM %s/location WHERE GEO_BOUNDING_BOX(center,100.0,1.0,101,0.0)", TEST_INDEX));
org.junit.Assert.assertEquals(1,results.getTotalHits());
SearchHit result = results.getAt(0);
Assert.assertEquals("square",result.getSource().get("description"));
}
示例3: geoDistance
import org.elasticsearch.search.SearchHits; //導入方法依賴的package包/類
@Test
public void geoDistance() throws SQLFeatureNotSupportedException, SqlParseException, InterruptedException {
SearchHits results = query(String.format("SELECT * FROM %s/location WHERE GEO_DISTANCE(center,'1km',100.5,0.500001)", TEST_INDEX));
org.junit.Assert.assertEquals(1,results.getTotalHits());
SearchHit result = results.getAt(0);
Assert.assertEquals("square",result.getSource().get("description"));
}
示例4: geoPolygon
import org.elasticsearch.search.SearchHits; //導入方法依賴的package包/類
@Test
public void geoPolygon() throws SQLFeatureNotSupportedException, SqlParseException, InterruptedException {
SearchHits results = query(String.format("SELECT * FROM %s/location WHERE GEO_POLYGON(center,100,0,100.5,2,101.0,0)", TEST_INDEX));
org.junit.Assert.assertEquals(1,results.getTotalHits());
SearchHit result = results.getAt(0);
Assert.assertEquals("square",result.getSource().get("description"));
}