Iam working on a library API and my goal is to search for a book. The book for now has two interesting values I want to search: The title and the blurb (The text on the back of a book).
The underlying database is MariaDB.
I constructed a JPA Query:
Iterable<Book> findByTitleContainsOrBlurbContains(String query, String query2)
The content(s) of query and query2 are the same. With a one term search this approach worked fine, but as soon as two or more words this approach stopped working when the words were mixed between blurb and title. This is understandable.
My second attempt was to split every term into a list of string values.
Iterable<Book> findByTitleContainsIsInOrBlurbContainsIsIn(List<String> query, List<String> query2);
This didnt work either. The application doesn't compile.
Is there a way to search two columns with a List of items in the contain-context?