# Match Any Enum in List/Set

**URL:** <https://discourse.hibernate.org/t/match-any-enum-in-list-set/4989>\
**Category:** Hibernate Search\
**Created:** [January 29, 2021, 12:41am UTC](https://discourse.hibernate.org/t/match-any-enum-in-list-set/4989 "2021-01-29T00:41:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![yrodiere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yrodiere/32/1760_2.png) [@yrodiere](https://discourse.hibernate.org/u/yrodiere)\
**Post date:** [October 13, 2021, 1:31pm UTC](https://discourse.hibernate.org/t/match-any-enum-in-list-set/4989/4 "2021-10-13T13:31:13Z")

</div>

To anyone ending up here looking for a solution:

> [@About Search query (HS 6 Beta 11)](https://discourse.hibernate.org/t/about-search-query-hs-6-beta-11/4687/4):
>
> 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, …

---

_[View the full topic](https://discourse.hibernate.org/t/match-any-enum-in-list-set/4989)._
