I'd like to have a properties set up to adjust fuzziness of elasticsearch search request as a whole application set up, i.e not changing this per @Query
of the individual MyEntitySearchRepository
. Is there a way to specify this using 1) some SpringBoot properties to be picked up by the Spring Data ElasticSearch 2) using ElasticsearchTemplate
to prepopulate it with the fuzzy value from the homegrown spring boot property, while the other part of the app queries to go to ElasticSearch should go from the Spring data definitions (index names, by/in/like parameters). Is it ever possible, or for now the only way it to set up individual @Query
to form the request json, containing fuzzy parameter like is described there and I can only paste the fuzzy value there being taken from the homegrown SpringBoot property?
Asked
Active
Viewed 455 times
1

Eljah
- 4,188
- 4
- 41
- 85
1 Answers
1
This is at the moment not possible, and I'm not sure if I understand you right: You want to define a global fuzzy setting that should be applied to all queries? On which fields of your document? All String fields? There is no global fuzzy setting in Elasticsearch itself, so it would be necessary to build custom queries internally.
At the moment the only way to go is with @Query
annotated custom repository methods.

P.J.Meisch
- 18,013
- 6
- 50
- 66
-
yes, I'd like to have a global setting for all String fields I have, that Spring Data will pick up and put into the query it generates (and yes, it would be great to have fuzzy-containing queries generated withoit @Query annotation, but based on the Spring Data approach like findOneByNameWithFuzzy3 – Eljah Sep 12 '19 at 22:01