You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Elastic Search provides the Search template API which is a very clean and efficient way to run queries in ElasticSearch.
A search template is a stored search you can run with different variables.
If you use Elasticsearch as a search backend, you can pass user input from a search bar as parameters for a search template. This lets you run searches without exposing Elasticsearch’s query syntax to your users.
If you use Elasticsearch for a custom application, search templates let you change your searches without modifying your app’s code.
I checked both in the documentation and the code and I couldn't find an annotation that supports it.
They idea would be to have something like:
@Repository
public interface SampleDataRepository extends Repository<SampleData, String> {
@SearchTemplateQuery(id="my-search-template")
List<SampleData> findSamples(String queryString, int from, int size);
}
Elastic Search provides the Search template API which is a very clean and efficient way to run queries in ElasticSearch.
I checked both in the documentation and the code and I couldn't find an annotation that supports it.
They idea would be to have something like:
Which translates into this (example taken from the Elasticsearch documentation):
In case it helps, without annotations we have to do it like this:
The text was updated successfully, but these errors were encountered: