About Search query (HS 6 Beta 11)

The terms predicate is there:

So you can create this query:

{
  "query": {
    "terms": {
      "user.id": [ "kimchy", "elkbee" ]
    }
  }
}

Like this:

List<Book> hits = searchSession.search( Book.class )
        .where( f -> f.terms().field( "user.id" )
                        .matchingAny( "kimchy", "elkbee" ) )
        .fetchHits( 20 );

Be aware that the terms predicate does not perform analysis (tokenization, normalization, etc.), so it’s mostly useful for ID fields, or enum fields, etc. Not for full-text search.

See also:

https://docs.jboss.org/hibernate/search/6.1/reference/en-US/html_single/#search-dsl-predicate-terms