You can use the matching
method with wildcard characters in your string: ?
represents a single character and *
represents any character sequence
So your code, for example, could be:
Query query = queryBuilder.keyword().onField("normVal").matching("*asthme*").createQuery();
You can find more details here
Edit after OP comment
If you have fixed values to search, like words with articles, you can also try something like this instead of wildcars:
Query query = queryBuilder.bool()
.should(queryBuilder.keyword().onField("normVal").matching("l'asthme").createQuery())
.should(queryBuilder.keyword().onField("normVal").matching("d'asthme").createQuery())
.should(queryBuilder.keyword().onField("normVal").matching("asthme").createQuery())
.createQuery();
Please notice that the should
method will work like an OR
query operator