Package org.elasticsearch.index.query

Examples of org.elasticsearch.index.query.FilterBuilder


     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/and-filter.html">documentation</a>
     */
    @Test
    public void andWithCacheFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.andFilter(
                FilterBuilders.rangeFilter("price").from("1").to("2"),
                FilterBuilders.prefixFilter("brand", "hei")
            ).cache(true);

        launchSearch(filter);
View Full Code Here


     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html">documentation</a>
     */
    @Test
    public void boolFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.boolFilter()
            .must(FilterBuilders.termFilter("brand", "heineken"))
            .mustNot(FilterBuilders.rangeFilter("price").from("1").to("2"))
            .should(FilterBuilders.termFilter("colour", "dark"))
            .should(FilterBuilders.termFilter("colour", "pale"))
           ;
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/exists-filter.html">documentation</a>
     */
    @Test
    public void existsFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.existsFilter("brand");

        launchSearch(filter);
    }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/ids-filter.html">documentation</a>
     */
    @Test
    public void idsFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.idsFilter("beer")
                .addIds("beer_1", "beer_4", "beer_100");

        launchSearch(filter);
    }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/limit-filter.html">documentation</a>
     */
    @Test
    public void limitFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.limitFilter(100);

        launchSearch(filter);
    }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/type-filter.html">documentation</a>
     */
    @Test
    public void typeFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.typeFilter("beer");

        launchSearch(filter);
    }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/geo-bounding-box-filter.html">documentation</a>
     */
    @Test @Ignore
    public void geoBoundingBoxFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.geoBoundingBoxFilter("pin.location")
                .topLeft(40.73, -74.1)
                .bottomRight(40.717, -73.99);

        launchSearch(filter);
    }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-filter.html">documentation</a>
     */
    @Test @Ignore
    public void geoDistanceFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.geoDistanceFilter("pin.location")
                .point(40, -70)
                .distance(200, DistanceUnit.KILOMETERS)
                .optimizeBbox("memory")
                .geoDistance(GeoDistance.ARC);

View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-range-filter.html">documentation</a>
     */
    @Test @Ignore
    public void geoDistanceRangeFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.geoDistanceRangeFilter("pin.location")
                .point(40, -70)
                .from("200km")
                .to("400km")
                .includeLower(true)
                .includeUpper(false)
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/geo-polygon-filter.html">documentation</a>
     */
    @Test @Ignore
    public void geoPolygonFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.geoPolygonFilter("pin.location")
                .addPoint(40, -70)
                .addPoint(30, -80)
                .addPoint(20, -90);

        launchSearch(filter);
View Full Code Here

TOP

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

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.