Example #1
0
  @Test
  public void QueryElement() throws Exception {
    Query query1 = serializer.toQuery(author.like("Michael"), metadata);
    Query query2 = serializer.toQuery(text.like("Text"), metadata);

    BooleanExpression query = Expressions.anyOf(new QueryElement(query1), new QueryElement(query2));
    testQuery(query, "author:michael text:text", 1);
  }
Example #2
0
 @Test
 public void Like_Empty_String() throws Exception {
   testQuery(title.like(""), "title:", 0);
 }
Example #3
0
 @Test
 public void Like_not_Does_Not_Find_Results() throws Exception {
   testQuery(title.like("*H*e*").not(), "-title:*h*e* +*:*", 1);
 }
Example #4
0
 @Test
 public void Like_and_like() throws Exception {
   testQuery(title.like("*assic*").and(rating.like("G?od")), "+title:*assic* +rating:g?od", 1);
 }
Example #5
0
 @Test
 public void Like_or_like() throws Exception {
   testQuery(title.like("House").or(author.like("*ichae*")), "title:house author:*ichae*", 1);
 }
Example #6
0
 @Test
 public void Like_Phrase() throws Exception {
   testQuery(title.like("*rassic Par*"), "+title:**rassic* +title:*par**", 1);
 }
Example #7
0
 @Test
 public void Like_Custom_Wildcard_Multiple_Character() throws Exception {
   testQuery(text.like("*U*X*"), "text:*u*x*", 1);
 }
Example #8
0
 @Test
 public void Like_Custom_Wildcard_Single_Character() throws Exception {
   testQuery(author.like("Mi?hael"), "author:mi?hael", 1);
 }
Example #9
0
 @Test
 public void Like() throws Exception {
   testQuery(author.like("*ichael*"), "author:*ichael*", 1);
 }