I want to use search templates to generate a query based on the value of a
parameter (not its presence or being True).
For example I have a sortType parameter that can be {nearest, cheapest,
easiest, newest}. Each of these options causes a drastically different
change to the query sent to ES.
I'm assuming that I'm currently limited to creating a boolean flag and
checking for the presence of sortType_nearest, sortType_cheapest etc.
It would be nice to have a template language supported that included an if
statement.
Apologies if this has already been mentioned, but I searched and couldn't
find anything.
I want to use search templates to generate a query based on the value of a
parameter (not its presence or being True).
For example I have a sortType parameter that can be {nearest, cheapest,
easiest, newest}. Each of these options causes a drastically different
change to the query sent to ES.
I'm assuming that I'm currently limited to creating a boolean flag and
checking for the presence of sortType_nearest, sortType_cheapest etc.
It would be nice to have a template language supported that included an if
statement.
Apologies if this has already been mentioned, but I searched and couldn't
find anything.
I want to use search templates to generate a query based on the value of
a parameter (not its presence or being True).
For example I have a sortType parameter that can be {nearest, cheapest,
easiest, newest}. Each of these options causes a drastically different
change to the query sent to ES.
I'm assuming that I'm currently limited to creating a boolean flag and
checking for the presence of sortType_nearest, sortType_cheapest etc.
It would be nice to have a template language supported that included an
if statement.
Apologies if this has already been mentioned, but I searched and couldn't
find anything.
I want to use search templates to generate a query based on the value of
a parameter (not its presence or being True).
For example I have a sortType parameter that can be {nearest, cheapest,
easiest, newest}. Each of these options causes a drastically different
change to the query sent to ES.
I'm assuming that I'm currently limited to creating a boolean flag and
checking for the presence of sortType_nearest, sortType_cheapest etc.
It would be nice to have a template language supported that included an
if statement.
Apologies if this has already been mentioned, but I searched and couldn't
find anything.
Templates in general should be logic-less, hence I support the decision of
using mustache. Support of handlebars and maybe also some help from Lucene
expressions may indeed come in handy, but still there may be ways of
achieving what you are after also using mustache
I think this SO answer summarizes all this very well:
I want to use search templates to generate a query based on the value of a
parameter (not its presence or being True).
For example I have a sortType parameter that can be {nearest, cheapest,
easiest, newest}. Each of these options causes a drastically different
change to the query sent to ES.
I'm assuming that I'm currently limited to creating a boolean flag and
checking for the presence of sortType_nearest, sortType_cheapest etc.
It would be nice to have a template language supported that included an if
statement.
Apologies if this has already been mentioned, but I searched and couldn't
find anything.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.