Package org.springframework.data.solr.core.query

Examples of org.springframework.data.solr.core.query.TermsQuery


    Assert.assertEquals("solr", parser.constructSolrQuery(q).getTermsRegex());
  }

  @Test
  public void testConstructSolrQueryIgnoresTermsRegexWhenNull() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().regex(null).build();
    Assert.assertNull(parser.constructSolrQuery(q).getTermsRegex());
  }
View Full Code Here


    Assert.assertNull(parser.constructSolrQuery(q).getTermsRegex());
  }

  @Test
  public void testConstructSolrQueryIgnoresTermsRegexWhenBlank() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().regex("   ").build();
    Assert.assertNull(parser.constructSolrQuery(q).getTermsRegex());
  }
View Full Code Here

    Assert.assertNull(parser.constructSolrQuery(q).getTermsRegex());
  }

  @Test
  public void testConstructSolrQueryProcessesTermsRegexFlagCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().regexFlag(RegexFlag.CASE_INSENSITIVE).build();
    Assert.assertArrayEquals(new String[] { "case_insensitive" }, parser.constructSolrQuery(q).getTermsRegexFlags());
  }
View Full Code Here

    Assert.assertArrayEquals(new String[] { "case_insensitive" }, parser.constructSolrQuery(q).getTermsRegexFlags());
  }

  @Test
  public void testConstructSolrQueryIgnoresTermsRegexFlagWhenNull() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().regexFlag(null).build();
    Assert.assertNull(parser.constructSolrQuery(q).getTermsRegexFlags());
  }
View Full Code Here

    Assert.assertNull(parser.constructSolrQuery(q).getTermsRegexFlags());
  }

  @Test
  public void testConstructSolrQueryProcessesTermsSortCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().sort(TermsOptions.Sort.INDEX).build();
    Assert.assertEquals("index", parser.constructSolrQuery(q).getTermsSortString());
  }
View Full Code Here

    Assert.assertEquals("index", parser.constructSolrQuery(q).getTermsSortString());
  }

  @Test
  public void testConstructSolrQueryIgnoresTermsSortWhenNull() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().sort(null).build();
    Assert.assertEquals("Expected SolrQuery default value: count", "count", parser.constructSolrQuery(q)
        .getTermsSortString());
  }
View Full Code Here

        .getTermsSortString());
  }

  @Test
  public void testConstructSolrQueryProcessesSingleFieldCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().fields("field_1").build();
    Assert.assertArrayEquals(new String[] { "field_1" }, parser.constructSolrQuery(q).getTermsFields());
  }
View Full Code Here

    Assert.assertArrayEquals(new String[] { "field_1" }, parser.constructSolrQuery(q).getTermsFields());
  }

  @Test
  public void testConstructSolrQueryProcessesMultipleFieldsCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder("field_1", "field_2", "field_3").build();
    Assert.assertArrayEquals(new String[] { "field_1", "field_2", "field_3" }, parser.constructSolrQuery(q)
        .getTermsFields());
  }
View Full Code Here

        .getTermsFields());
  }

  @Test
  public void testConstructSolrQueryProcessesRequestHandlerCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().handledBy("/termsRequestHandler").build();

    Assert.assertEquals("/termsRequestHandler", parser.constructSolrQuery(q).getRequestHandler());
  }
View Full Code Here

    Assert.assertEquals("/termsRequestHandler", parser.constructSolrQuery(q).getRequestHandler());
  }

  @Test
  public void testConstructSolrQuerySetRequestHandlerToDefaultWhenNull() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().handledBy(null).build();

    Assert.assertEquals("/terms", parser.constructSolrQuery(q).getRequestHandler());
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.solr.core.query.TermsQuery

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.