Example #1
0
 @Test
 public void Eq_or_Eq_and_Eq_Does_Not_Find_Results() throws Exception {
   testQuery(
       title.eq("jeeves").or(rating.eq("superb")).and(author.eq("michael crichton")),
       "+(title:jeeves rating:superb) +author:\"michael crichton\"",
       0);
 }
Example #2
0
 @Test
 @Ignore
 public void Eq_and_Eq_and_eq() throws Exception {
   testQuery(
       title.eq("Jurassic Park").and(year.eq(1990)).and(author.eq("Michael Crichton")),
       "+(+title:\"jurassic park\" +year:" + YEAR_PREFIX_CODED + ") +author:\"michael crichton\"",
       1);
 }
Example #3
0
 @Test
 public void Nothing_Found_With_Not_Equals_Or_Equals() throws Exception {
   testQuery(
       title.ne("jurassic park").or(rating.eq("lousy")),
       "(-title:\"jurassic park\" +*:*) rating:lousy",
       0);
 }
Example #4
0
 @Test
 @Ignore
 public void Eq_and_eq() throws Exception {
   testQuery(
       title.eq("Jurassic Park").and(year.eq(1990)),
       "+title:\"jurassic park\" +year:" + YEAR_PREFIX_CODED,
       1);
 }
Example #5
0
 @Test
 public void Ne_and_eq() throws Exception {
   testQuery(title.ne("house").and(rating.eq("good")), "+(-title:house +*:*) +rating:good", 1);
 }
Example #6
0
 @Test
 public void Eq_and_Eq_not_Does_Not_Find_Results_Because_Second_Expression_Finds_Nothing()
     throws Exception {
   testQuery(
       rating.eq("superb").and(title.eq("house").not()), "+rating:superb +(-title:house +*:*)", 0);
 }
Example #7
0
 @Test
 public void Title_Equals_Not_House() throws Exception {
   testQuery(title.eq("house").not(), "-title:house +*:*", 1);
 }
Example #8
0
 @Test
 public void Eq_not_Does_Not_Find_Results() throws Exception {
   testQuery(title.eq("Jurassic Park").not(), "-title:\"jurassic park\" +*:*", 0);
 }
Example #9
0
 @Test
 public void Eq_Phrase_Does_Not_Find_Results_Because_Word_In_Middle() throws Exception {
   testQuery(title.eq("Jurassic Amusement Park"), "title:\"jurassic amusement park\"", 0);
 }
Example #10
0
 @Test
 public void Eq_with_deep_path() throws Exception {
   StringPath deepPath = entityPath.get("property1", Object.class).getString("property2");
   testQuery(deepPath.eq("good"), "property1.property2:good", 0);
 }
Example #11
0
 @Test
 @Ignore("Not easily done in Lucene!")
 public void Publisher_Equals_Empty_String() throws Exception {
   testQuery(publisher.eq(""), "publisher:", 1);
 }
Example #12
0
 @Test
 public void Eq_Phrase() throws Exception {
   testQuery(title.eq("Jurassic Park"), "title:\"jurassic park\"", 1);
 }
Example #13
0
 @Test
 public void Equals_Ignores_Case() throws Exception {
   testQuery(title.eq("Jurassic"), "title:jurassic", 1);
 }
Example #14
0
 @Test
 public void In() throws Exception {
   testQuery(title.in(Arrays.asList("jurassic", "park")), "title:jurassic title:park", 1);
   testQuery(title.in("jurassic", "park"), "title:jurassic title:park", 1);
   testQuery(title.eq("jurassic").or(title.eq("park")), "title:jurassic title:park", 1);
 }
Example #15
0
 @Test
 public void Eq_Phrase_Should_Not_Find_Results_But_LuceNe_Semantics_Differs_From_Querydsls()
     throws Exception {
   testQuery(text.eq("UNIX System"), "text:\"unix system\"", 1);
 }
Example #16
0
 @Test
 public void Equals_Empty_String() throws Exception {
   testQuery(title.eq(""), "title:", 0);
 }
Example #17
0
 @Test
 public void Eq() throws Exception {
   testQuery(rating.eq("good"), "rating:good", 1);
 }