Search in sources :

Example 1 with CustomPhraseQuery

use of org.opengrok.suggest.query.customized.CustomPhraseQuery in project OpenGrok by OpenGrok.

the class SuggesterPhraseQueryTest method phraseQueryTest.

@Test
public void phraseQueryTest() throws Exception {
    SuggesterPhraseQuery q = new SuggesterPhraseQuery("test", "ident", Arrays.asList("one", "two", "tident"), 0);
    CustomPhraseQuery query = q.getPhraseQuery();
    assertEquals(2, query.getOffset());
    Term[] terms = getTerms(query);
    assertEquals("one", terms[0].text());
    assertEquals("two", terms[1].text());
}
Also used : CustomPhraseQuery(org.opengrok.suggest.query.customized.CustomPhraseQuery) Term(org.apache.lucene.index.Term) Test(org.junit.jupiter.api.Test)

Aggregations

Term (org.apache.lucene.index.Term)1 Test (org.junit.jupiter.api.Test)1 CustomPhraseQuery (org.opengrok.suggest.query.customized.CustomPhraseQuery)1