Does anyone know if this is possible? The closest thing I've seen is the save query option in Kibana. But I'd like to have this for Java/Spring. My idea is for users to build their own elasticsearch queries (works!) and I want to add the option to be able to save them for reuse. Does Elasticsearch or a library for Java/Spring support this function? I'm aware of search templates but it seems better for searchbar inputs and not something where a user can 'build' possibly complicated queries at will.
My last-resort-dumb-idea is to just save the entire query DSL as string or json somewhere and just send it again.
You can store the query in a elasticsearch index by using the field type
percolatoryour indexmappingshould be somethings like this