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/geo-shape-filter.html">documentation</a>
     */
    @Test @Ignore
    public void geoShapeFilter() throws Exception {
        FilterBuilder filter = null;

        // Shape within another
        filter = FilterBuilders.geoShapeFilter("location",
                new RectangleImpl(0,10,0,10,SpatialContext.GEO))
                .relation(ShapeRelation.WITHIN);
View Full Code Here


     * <br>See <a href="http://www.elasticsearch.org/guide/reference/java-api/query-dsl.html">documentation</a>
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/has-child-filter.html">documentation</a>
     */
    @Test
    public void hasChildFilter() throws Exception {
        FilterBuilder qb = FilterBuilders.hasChildFilter("blog_tag",
                QueryBuilders.termQuery("tag", "something"));

        logger.info("Your query is : {}", qb);

        // TODO Create a test here
View Full Code Here

     * <br>See <a href="http://www.elasticsearch.org/guide/reference/java-api/query-dsl.html">documentation</a>
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/has-parent-filter.html">documentation</a>
     */
    @Test
    public void hasParentFilter() throws Exception {
        FilterBuilder qb = FilterBuilders.hasParentFilter("blog",
                QueryBuilders.termQuery("tag", "something"));

        logger.info("Your query is : {}", qb);

        // TODO Create a test here
View Full Code Here

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

        launchSearch(filter);
    }
View Full Code Here

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

        launchSearch(filter);
    }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/not-filter.html">documentation</a>
     */
    @Test
    public void notFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.notFilter(
                FilterBuilders.rangeFilter("price").from("1").to("2")
        );

        launchSearch(filter);
    }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/numeric-range-filter.html">documentation</a>
     */
    @Test
    public void numericRangeFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.numericRangeFilter("price")
                .from(1)
                .to(2)
                .includeLower(true)
                .includeUpper(false);

View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/or-filter.html">documentation</a>
     */
    @Test
    public void orFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.orFilter(
                FilterBuilders.termFilter("name.second", "banon"),
                FilterBuilders.termFilter("name.nick", "kimchy")
        );

        launchSearch(filter);
View Full Code Here

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

        launchSearch(filter);
    }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/query-dsl/query-filter.html">documentation</a>
     */
    @Test
    public void queryFilter() throws Exception {
        FilterBuilder filter = FilterBuilders.queryFilter(
                QueryBuilders.queryString("heineken AND pale OR dark")
        );

        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.