search/engine/impl-lucene/src/test/java/net/sf/mmm/search/engine/impl/lucene/LuceneSearchQueryBuilderFactoryTest.java
/**
   * Test of {@link SearchQueryBuilder#createWordQuery(String, String)} for prefix query.
   */
Test of  SearchQueryBuilder#createWordQuery(String, String) for prefix query.
Test of SearchQueryBuilder#createWordQuery ( String String ) for prefix query .
@Test
  public void testCreateTermQueryPrefix() {
    SearchQueryBuilder queryBuilder = getQueryBuilder();
    SearchQuery query = queryBuilder.createWordQuery(SearchEntry.FIELD_TEXT, "foo*");
    PrefixQuery luceneQuery = getLuceneQuery(query, PrefixQuery.class);
    Term term = luceneQuery.getPrefix();
    Assert.assertNotNull(term);
    Assert.assertEquals("foo", term.text());
    Assert.assertEquals(SearchEntry.FIELD_TEXT, term.field());
  }
@ Test public void testCreateTermQueryPrefix ( ) { SearchQueryBuilder queryBuilder = getQueryBuilder ( ) ; SearchQuery query = queryBuilder . createWordQuery ( SearchEntry . FIELD_TEXT , "foo*" ) ; PrefixQuery luceneQuery = getLuceneQuery ( query , PrefixQuery . class ) ; Term term = luceneQuery . getPrefix ( ) ; Assert . assertNotNull ( term ) ; Assert . assertEquals ( "foo" , term . text ( ) ) ; Assert . assertEquals ( SearchEntry . FIELD_TEXT , term . field ( ) ) ; }
Test of {@link SearchQueryBuilder#createWordQuery(String, String)} for prefix query.
Test of { @link SearchQueryBuilder#createWordQuery ( String String ) } for prefix query .