Are there bind variables in Elastic and if yes, how to use them?

Good afternoon.

In the past, I've been working with Oracle database, and there there was the usage of so-called "bind variables", let me explain:
The handling of a query happens as follows:

  • parse query (translate into internal language)
  • execute it
  • fetch the data (get the results into your environment

Apparently the parsing took quite some time, so let's have a look at a large amount of similar queries:

select column_name from table_name where field=1;
select column_name from table_name where field=2;
select column_name from table_name where field=3;

Here every query gets parsed separately.

If the queries gets translated into something more general:

select column_name from table_name where field=%input_value%;
select column_name from table_name where field=%input_value%;
select column_name from table_name where field=%input_value%;

=> here the parsing only needs to be done once, saving a lot of time, increasing the performance of the application, based on those queries.

The variable %input_value% is called a "bind variable".

I know that this feature exists on Oracle database. Can anybody confirm whether or not this exists on Elastic and in case yes, can you refer me to some documentation on how to use those variables?

Thanks in advance

You might want to check out search templates

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.