use of com.querydsl.lucene5.PhraseElement in project querydsl by querydsl.
the class PhraseElementTest method hashCode_.
@Test
public void hashCode_() {
PhraseElement el1 = new PhraseElement("x"), el2 = new PhraseElement("x");
assertEquals(el1.hashCode(), el2.hashCode());
}
use of com.querydsl.lucene5.PhraseElement in project querydsl by querydsl.
the class PhraseElementTest method equals.
@Test
public void equals() {
PhraseElement el1 = new PhraseElement("x"), el2 = new PhraseElement("x"), el3 = new PhraseElement("y");
assertEquals(el1, el2);
assertFalse(el1.equals(el3));
}
use of com.querydsl.lucene5.PhraseElement in project querydsl by querydsl.
the class PhraseElementTest method test.
@Test
public void test() {
StringPath title = Expressions.stringPath("title");
LuceneSerializer serializer = new LuceneSerializer(false, false);
QueryMetadata metadata = new DefaultQueryMetadata();
assertEquals("title:Hello World", serializer.toQuery(title.eq("Hello World"), metadata).toString());
assertEquals("title:\"Hello World\"", serializer.toQuery(title.eq(new PhraseElement("Hello World")), metadata).toString());
}
Aggregations