Hibernate Search does not support transforming a single DSL predicate; transformation is at the request level only. If you need native features, the lowest granularity you can work on is a whole predicate.
So, without going as far as the request transformer, you can use native predicates:
The result of f.fromJson is a predicate like any other, which can be mixed with other DSL predicates (e.g. in boolean predicates).
That being said, if the only thing you need is to add the fuzzy_transpositions parameter to the match predicate, you can open a ticket and send a pull request to add a S fuzzy(int maxEditDistance, int exactPrefixLength, boolean transpositions) method to org.hibernate.search.engine.search.predicate.dsl.MatchPredicateOptionsStep (and implement it); I’ll be happy to review the PR and help you write the corresponding tests.
Thank you for your answer. In fact I anticipate a bit, I imagine complainers wanting to tune the search result relevance. Native predicates is a good starting point.
Thanks for the invitation to enrich API, but I need to find time apart from working days for this . By the way, the perimeter of the API is larger than “just” elastic search, this method would be specific I suppose.