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

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


    this.parser = new TermsQueryParser();
  }

  @Test
  public void testConstructSolrQueryProcessesTermsLimitCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().limit(100).build();
    Assert.assertEquals(100, parser.constructSolrQuery(q).getTermsLimit());
  }
View Full Code Here


    Assert.assertEquals(100, parser.constructSolrQuery(q).getTermsLimit());
  }

  @Test
  public void testConstructSolrQueryIgnoresTermsLimitLessThanZero() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().limit(-1).build();
    Assert.assertEquals("Expected SolrQuery default value: 10", 10, parser.constructSolrQuery(q).getTermsLimit());
  }
View Full Code Here

    Assert.assertEquals("Expected SolrQuery default value: 10", 10, parser.constructSolrQuery(q).getTermsLimit());
  }

  @Test
  public void testConstructSolrQueryProcessesTermsMaxCountCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().maxCount(100).build();
    Assert.assertEquals(100, parser.constructSolrQuery(q).getTermsMaxCount());
  }
View Full Code Here

    Assert.assertEquals(100, parser.constructSolrQuery(q).getTermsMaxCount());
  }

  @Test
  public void testConstructSolrQueryIgnoresTermsMaxCountLessThanMinusOne() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().maxCount(-2).build();
    Assert.assertEquals("Expected SolrQuery default value: -1", -1, parser.constructSolrQuery(q).getTermsMaxCount());
  }
View Full Code Here

    Assert.assertEquals("Expected SolrQuery default value: -1", -1, parser.constructSolrQuery(q).getTermsMaxCount());
  }

  @Test
  public void testConstructSolrQueryProcessesTermsMinCountCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().minCount(100).build();
    Assert.assertEquals(100, parser.constructSolrQuery(q).getTermsMinCount());
  }
View Full Code Here

    Assert.assertEquals(100, parser.constructSolrQuery(q).getTermsMinCount());
  }

  @Test
  public void testConstructSolrQueryIgnoresTermsMinCountLessThanZero() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().minCount(-1).build();
    Assert.assertEquals("Expected SolrQuery default value: 1", 1, parser.constructSolrQuery(q).getTermsMinCount());
  }
View Full Code Here

    Assert.assertEquals("Expected SolrQuery default value: 1", 1, parser.constructSolrQuery(q).getTermsMinCount());
  }

  @Test
  public void testConstructSolrQueryProcessesTermsPrefixCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().prefix("springdata").build();
    Assert.assertEquals("springdata", parser.constructSolrQuery(q).getTermsPrefix());
  }
View Full Code Here

    Assert.assertEquals("springdata", parser.constructSolrQuery(q).getTermsPrefix());
  }

  @Test
  public void testConstructSolrQueryIgnoresTermsPrefixWhenNull() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().prefix(null).build();
    Assert.assertEquals("Expected SolrQuery default value: <empty string>", "", parser.constructSolrQuery(q)
        .getTermsPrefix());
  }
View Full Code Here

        .getTermsPrefix());
  }

  @Test
  public void testConstructSolrQueryIgnoresTermsPrefixWhenBlank() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().prefix("   ").build();
    Assert.assertEquals("Expected SolrQuery default value: <empty string>", "", parser.constructSolrQuery(q)
        .getTermsPrefix());
  }
View Full Code Here

        .getTermsPrefix());
  }

  @Test
  public void testConstructSolrQueryProcessesTermsRegexCorrectly() {
    TermsQuery q = SimpleTermsQuery.queryBuilder().regex("solr").build();
    Assert.assertEquals("solr", parser.constructSolrQuery(q).getTermsRegex());
  }
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.