Examples of FullTextQuery


Examples of org.hibernate.search.jpa.FullTextQuery

    final QueryBuilder b = ftem.getSearchFactory()
        .buildQueryBuilder()
        .forEntity( Insurance.class )
        .get();
    final Query lq = b.keyword().onField( "name" ).matching( "Macif" ).createQuery();
    final FullTextQuery ftQuery = ftem.createFullTextQuery( lq, Insurance.class );
    ftQuery.initializeObjectsWith( ObjectLookupMethod.SKIP, DatabaseRetrievalMethod.FIND_BY_ID );
    final List<Insurance> resultList = ftQuery.getResultList();
    assertThat( getFactory().getPersistenceUnitUtil().isLoaded( resultList.get( 0 ) ) ).isTrue();
    assertThat( resultList ).hasSize( 1 );
    for ( Object e : resultList ) {
      ftem.remove( e );
    }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextQuery

    );

    org.apache.lucene.search.Query luceneQuery;
    luceneQuery = parser.parse( searchQuery );

    final FullTextQuery query = ftEm.createFullTextQuery( luceneQuery, Book.class );

    return query;
  }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextQuery

                boostPerField);

        org.apache.lucene.search.Query luceneQuery;
        luceneQuery = parser.parse(searchQuery);

        final FullTextQuery query = ftEm.createFullTextQuery(luceneQuery, Book.class);

        return query;
    }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextQuery

    );

    org.apache.lucene.search.Query luceneQuery;
    luceneQuery = parser.parse( searchQuery );

    final FullTextQuery query = ftEm.createFullTextQuery( luceneQuery, Book.class );

    return query;
  }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextQuery

    );

    org.apache.lucene.search.Query luceneQuery;
    luceneQuery = parser.parse( searchQuery );

    final FullTextQuery query = ftEm.createFullTextQuery( luceneQuery, Book.class );

    return query;
  }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextQuery

          .forEntity(indexedClass).get();
  }

  @SuppressWarnings("unchecked")
  protected Page<E> searchPage(Page<E> page, Query query) {
    FullTextQuery fullTextQuery = getFullTextEntityManager()
        .createFullTextQuery(query, indexedClass);
    appendOrders(page, fullTextQuery);
    if (page.getAutoCount()) {
      page.setTotalCount((long) fullTextQuery.getResultSize());
      page.setAutoCount(false);
    }
    //
    fullTextQuery.setFirstResult(page.getFirst() - 1);
    fullTextQuery.setMaxResults(page.getPageSize());
    return page.setResult(fullTextQuery.getResultList());
  }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextQuery

    fullTextQuery.setMaxResults(page.getPageSize());
    return page.setResult(fullTextQuery.getResultList());
  }
 
  protected Integer count(Query query) {
    FullTextQuery fullTextQuery = getFullTextEntityManager().createFullTextQuery(query, indexedClass);
    return fullTextQuery.getResultSize();
  }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextQuery

   }

   public List<Book> findByKeyword(String keyword) {
      FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(em);
      TermQuery termQuery = new TermQuery(new Term("title", keyword));
      FullTextQuery fullTextQuery = fullTextEntityManager.createFullTextQuery(termQuery, Book.class);
      return fullTextQuery.getResultList();
   }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextQuery

                boostPerField);

        org.apache.lucene.search.Query luceneQuery;
        luceneQuery = parser.parse(searchQuery);

        final FullTextQuery query = ftEm.createFullTextQuery(luceneQuery, Book.class);

        return query;
    }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextQuery

    );

    org.apache.lucene.search.Query luceneQuery;
    luceneQuery = parser.parse( searchQuery );

    final FullTextQuery query = ftEm.createFullTextQuery( luceneQuery, Book.class );

    return query;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.