2.6. Querying Hibernate Search

This chapter describes the querying functionality of the Hibernate Search module.

2.6.1. Creating the Querydsl query types

See Querying JPA/Hibernate sources for instructions on how to create query types.

2.6.2. Querying

Querying with Querydsl Hibernate Search is as simple as this:

QUser user = QUser.user;
SearchQuery<User> query = new SearchQuery<User>(session, user);
List<User> list = query
    .where(user.firstName.eq("Bob"))
    .list();

2.6.3. General usage

For general usage instructions see Querying Lucene sources .

In the query serialization the only difference to the Querydsl Lucene module is that paths are treated differently. For org.hibernate.search.annotations.Field annotated properties the name attribute is used with the property name as fallback for the field name.