Home > OS >  How to do a partial search in Hibernate Panache
How to do a partial search in Hibernate Panache

Time:05-28

I'm trying to do a partial search using Hibernate Panache. I'm building a backend using Quarkus and Kotlin. Now when my frontend gives me a search string I'd like to return all partial results.

I have the following query:

repository.find("firstName LIKE '%?1%'", value)

Now I've tried a couple of variations of this, including one with the .list() method.

Does anyone know how I should handle this?

CodePudding user response:

repository.list( "lower(firstName) LIKE ?1", value.toLowerCase()   "%" );

But if you need more complex full-text queries, I would suggest to have a look at Hibernate Search

  • Related