Package org.elasticsearch.index.query

Examples of org.elasticsearch.index.query.GeoShapeFilterBuilder


    // Action
    ShapeBuilder shape = buildSquareShape(48.675763, 2.379358, 20);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.WAY.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(1, searchResponse.getHits().hits().length);
  }
View Full Code Here


    // Action
        ShapeBuilder shape = buildSquareShape(48.676455, 2.380899, 20);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.WAY.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(0, searchResponse.getHits().hits().length);
  }
View Full Code Here

    // Action
        ShapeBuilder shape = buildSquareShape(48.675763, 2.379358, 10000);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.WAY.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(1, searchResponse.getHits().hits().length);
  }
View Full Code Here

    // ~ 45 meters min shape radius to match
    // center between positions index #5 and #6
        ShapeBuilder shape = buildSquareShape(48.675689, 2.38259, 45);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.WAY.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(1, searchResponse.getHits().hits().length);
  }
View Full Code Here

    // Action
    ShapeBuilder shape = buildSquareShape(48.675763, 2.379358, 100);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.WAY.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(1, searchResponse.getHits().hits().length);
  }
View Full Code Here

    // Action
    ShapeBuilder shape = buildSquareShape(48.676455, 2.380899, 20);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.WAY.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(0, searchResponse.getHits().hits().length);
  }
View Full Code Here

    // Action
    ShapeBuilder shape = buildSquareShape(48.675652, 2.384955, 20);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.NODE.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(1, searchResponse.getHits().hits().length);
  }
View Full Code Here

    // Action
    ShapeBuilder shape = buildSquareShape(48.676455, 2.380899, 20);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.NODE.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(0, searchResponse.getHits().hits().length);
  }
View Full Code Here

    // Action
    ShapeBuilder shape = buildSquareShape(48.675652, 2.384955, 10000);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.NODE.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(1, searchResponse.getHits().hits().length);
  }
View Full Code Here

    // Action
    // Can't do better than 20m with default shape configuration
    ShapeBuilder shape = buildSquareShape(48.675652, 2.384955, 20);
    SearchResponse searchResponse = client().prepareSearch(INDEX_NAME).setTypes(ESEntityType.NODE.getIndiceName())
        .setQuery(QueryBuilders.matchAllQuery())
        .setPostFilter(new GeoShapeFilterBuilder("shape", shape))
        .execute().actionGet();

    // Assert
    Assert.assertEquals(1, searchResponse.getHits().hits().length);
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.query.GeoShapeFilterBuilder

Copyright © 2018 www.massapicom. 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.