當前位置: 首頁>>代碼示例>>Java>>正文


Java SearchHits.getAt方法代碼示例

本文整理匯總了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"));
}
 
開發者ID:mazhou,項目名稱:es-sql,代碼行數:8,代碼來源:QueryTest.java

示例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"));
}
 
開發者ID:mazhou,項目名稱:es-sql,代碼行數:8,代碼來源:QueryTest.java

示例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"));
}
 
開發者ID:mazhou,項目名稱:es-sql,代碼行數:8,代碼來源:QueryTest.java

示例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"));
}
 
開發者ID:mazhou,項目名稱:es-sql,代碼行數:8,代碼來源:QueryTest.java


注:本文中的org.elasticsearch.search.SearchHits.getAt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。