Package org.elasticsearch.common.lucene.search

Examples of org.elasticsearch.common.lucene.search.RegexpFilter.regexp()


        assertThat(parsedQuery, instanceOf(FilteredQuery.class));
        Filter filter = ((FilteredQuery) parsedQuery).getFilter();
        assertThat(filter, instanceOf(RegexpFilter.class));
        RegexpFilter regexpFilter = (RegexpFilter) filter;
        assertThat(regexpFilter.field(), equalTo("name.first"));
        assertThat(regexpFilter.regexp(), equalTo("s.*y"));
    }

    @Test
    public void testRegexpFilteredQueryWithMaxDeterminizedStates() throws IOException {
        IndexQueryParserService queryParser = queryParser();
View Full Code Here


        assertThat(parsedQuery, instanceOf(FilteredQuery.class));
        Filter filter = ((FilteredQuery) parsedQuery).getFilter();
        assertThat(filter, instanceOf(RegexpFilter.class));
        RegexpFilter regexpFilter = (RegexpFilter) filter;
        assertThat(regexpFilter.field(), equalTo("name.first"));
        assertThat(regexpFilter.regexp(), equalTo("s.*y"));
    }

    @Test
    public void testNamedRegexpFilteredQuery() throws IOException {
        IndexQueryParserService queryParser = queryParser();
View Full Code Here

        assertThat(parsedQuery.query(), instanceOf(FilteredQuery.class));
        Filter filter = ((FilteredQuery) parsedQuery.query()).getFilter();
        assertThat(filter, instanceOf(RegexpFilter.class));
        RegexpFilter regexpFilter = (RegexpFilter) filter;
        assertThat(regexpFilter.field(), equalTo("name.first"));
        assertThat(regexpFilter.regexp(), equalTo("s.*y"));
    }

    @Test
    public void testRegexpWithFlagsFilteredQuery() throws IOException {
        IndexQueryParserService queryParser = queryParser();
View Full Code Here

        assertThat(parsedQuery.query(), instanceOf(FilteredQuery.class));
        Filter filter = ((FilteredQuery) parsedQuery.query()).getFilter();
        assertThat(filter, instanceOf(RegexpFilter.class));
        RegexpFilter regexpFilter = (RegexpFilter) filter;
        assertThat(regexpFilter.field(), equalTo("name.first"));
        assertThat(regexpFilter.regexp(), equalTo("s.*y"));
        assertThat(regexpFilter.flags(), equalTo(INTERSECTION.value() | COMPLEMENT.value() | EMPTY.value()));
    }

    @Test
    public void testNamedAndCachedRegexpWithFlagsFilteredQuery() throws IOException {
View Full Code Here

        CacheKeyFilter.Wrapper wrapper = (CacheKeyFilter.Wrapper) filter;
        assertThat(new BytesRef(wrapper.cacheKey().bytes()).utf8ToString(), equalTo("key"));
        assertThat(wrapper.wrappedFilter(), instanceOf(RegexpFilter.class));
        RegexpFilter regexpFilter = (RegexpFilter) wrapper.wrappedFilter();
        assertThat(regexpFilter.field(), equalTo("name.first"));
        assertThat(regexpFilter.regexp(), equalTo("s.*y"));
        assertThat(regexpFilter.flags(), equalTo(INTERSECTION.value() | COMPLEMENT.value() | EMPTY.value()));
    }

    @Test
    public void testRegexpBoostQuery() throws IOException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.