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

Examples of org.springframework.data.solr.core.query.Criteria$Predicate


    Assert.assertEquals("field_1:value_1^2.0", queryParser.createQueryStringFromCriteria(criteria));
  }

  @Test
  public void testBoostMultipleValues() {
    Criteria criteria = new Criteria("field_1").is("value_1").is("value_2").boost(2f);
    Assert.assertEquals("field_1:(value_1 value_2)^2.0", queryParser.createQueryStringFromCriteria(criteria));
  }
View Full Code Here


    Assert.assertEquals("field_1:(value_1 value_2)^2.0", queryParser.createQueryStringFromCriteria(criteria));
  }

  @Test
  public void testBoostMultipleCriteriasValues() {
    Criteria criteria = new Criteria("field_1").is("value_1").is("value_2").boost(2f).and("field_3").is("value_3");
    Assert.assertEquals("field_1:(value_1 value_2)^2.0 AND field_3:value_3",
        queryParser.createQueryStringFromNode(criteria));
  }
View Full Code Here

        queryParser.createQueryStringFromNode(criteria));
  }

  @Test
  public void testBetween() {
    Criteria criteria = new Criteria("field_1").between(100, 200);
    Assert.assertEquals("field_1:[100 TO 200]", queryParser.createQueryStringFromCriteria(criteria));
  }
View Full Code Here

    Assert.assertEquals("field_1:[100 TO 200]", queryParser.createQueryStringFromCriteria(criteria));
  }

  @Test
  public void testBetweenExcludeLowerBound() {
    Criteria criteria = new Criteria("field_1").between(100, 200, false, true);
    Assert.assertEquals("field_1:{100 TO 200]", queryParser.createQueryStringFromCriteria(criteria));
  }
View Full Code Here

    Assert.assertEquals("field_1:{100 TO 200]", queryParser.createQueryStringFromCriteria(criteria));
  }

  @Test
  public void testBetweenExcludeUpperBound() {
    Criteria criteria = new Criteria("field_1").between(100, 200, true, false);
    Assert.assertEquals("field_1:[100 TO 200}", queryParser.createQueryStringFromCriteria(criteria));
  }
View Full Code Here

    Assert.assertEquals("field_1:[100 TO 200}", queryParser.createQueryStringFromCriteria(criteria));
  }

  @Test
  public void testBetweenWithoutUpperBound() {
    Criteria criteria = new Criteria("field_1").between(100, null);
    Assert.assertEquals("field_1:[100 TO *]", queryParser.createQueryStringFromCriteria(criteria));
  }
View Full Code Here

    Assert.assertEquals("field_1:[100 TO *]", queryParser.createQueryStringFromCriteria(criteria));
  }

  @Test
  public void testBetweenWithoutLowerBound() {
    Criteria criteria = new Criteria("field_1").between(null, 200);
    Assert.assertEquals("field_1:[* TO 200]", queryParser.createQueryStringFromCriteria(criteria));
  }
View Full Code Here

  @Test
  public void testBetweenWithDateValue() {
    DateTime lowerBound = new DateTime(2012, 8, 21, 6, 35, 0, DateTimeZone.UTC);
    DateTime upperBound = new DateTime(2012, 8, 21, 19, 30, 0, DateTimeZone.UTC);

    Criteria criteria = new Criteria("field_1").between(lowerBound, upperBound);
    Assert.assertEquals("field_1:[2012\\-08\\-21T06\\:35\\:00.000Z TO 2012\\-08\\-21T19\\:30\\:00.000Z]",
        queryParser.createQueryStringFromCriteria(criteria));
  }
View Full Code Here

        queryParser.createQueryStringFromCriteria(criteria));
  }

  @Test
  public void testBetweenNegativeNumber() {
    Criteria criteria = new Criteria("field_1").between(-200, -100);
    Assert.assertEquals("field_1:[\\-200 TO \\-100]", queryParser.createQueryStringFromCriteria(criteria));
  }
View Full Code Here

    Assert.assertEquals("field_1:[\\-200 TO \\-100]", queryParser.createQueryStringFromCriteria(criteria));
  }

  @Test
  public void testIn() {
    Criteria criteria = new Criteria("field_1").in(1, 2, 3, 5, 8, 13, 21);
    Assert.assertEquals("field_1:(1 2 3 5 8 13 21)", queryParser.createQueryStringFromCriteria(criteria));
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.solr.core.query.Criteria$Predicate

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.