Questions tagged [elasticsearch-template]

49 questions
7
votes
2 answers

Elasticsearch update index template

I have a question about elasticsearch index template, there is a scene of my question. Create a template for a series indices, named templateA, and there are some indices create from this template, named Index-yyyy.mm.dd2 and Index-yyyy.mm.dd2.…
5
votes
0 answers

Full dotted path (any level path) with path_match in dynamic_templates

I have this document { "text_foo": "lorem ipsum", "one":{ "two":{ "three":{ "text_bar": "dolor sit amet" } } } } What i'm trying to acomplish: I need dynamic template, that will…
4
votes
3 answers

Elasticsearch Mustache optional parameters

I've been struggling with Elasticsearch templates, specifically in optional parameters. I'd like to add optional filters there. This is the code snippet I was trying out: { "filter" : { "bool" : { "must" : [ {{#ProductIDs.0}} …
3
votes
1 answer

ElasticSearch: Weird problem in inserting documents to ElasticSearch indices when a template is present

I am trying to do some testing in ElasticSearch. I am able to populate everything as required but whenever I try to put our project's default template and then insert, the data is not ingested in the index (http calls are successful though). Upon…
3
votes
0 answers

Invalid json while pushing search template to ElasticSearch

I am developing a webapp, for which I am pushing my search templates to ES during startup and using them to form the elastic search queries at runtime. I have a requirement wherein, I don't know the number of filters to be applied. Created a search…
3
votes
1 answer

Elasticsearch dynamic template: don’t want field to be analyzed, only want a keyword subfield

We're using a dynamic template to specify mapping for certain fields in our index. Most text fields are not mentioned in the template, and get the default mapping to an analyzed field and a keyword subfield: "someField" : { …
3
votes
0 answers

Spring data elasticsearch with username and password

I am using spring data for the elasticsearch and using transport client with the below configuration for elasticsearchtemplate. I am wondering how we can provide the shield user name and password to the elasticsearchtemplate. Can we do…
2
votes
1 answer

How to work on the filter in the elasticsearch template?

I have similar kind of data set to work on with Elasticsearch. { "id" :1, "title" : "Toy Story 1", "year" : 1995 , "category" : "Adventure" }, { "id" :2, "title" : "Jumanji", "year" : 1995, "category" :…
Abhijit Bashetti
  • 8,518
  • 7
  • 35
  • 47
2
votes
0 answers

More like this query with ElasticsearchTemplate

In "More like this query" we can specify not only documents, but some other text: { "more_like_this" : { "fields" : ["title", "description"], "like" : [ { "_index" : "imdb", "_type" : "movies", "_id" : "1" }, "and potentially some more…
1
vote
1 answer

How could I put shard size explicitly by template in AWS elasticsearch?

I am new to elasticsearch. I have only one shard with no replica, this shard gets default shard size. Now I want to add shard size explicitly by using template. But when I search for this here, it don't have any property to set shard size. Am I…
1
vote
1 answer

How to get all documents from a filter in Elasticsearch?

If I deliver the empty params (see below) I would like to get all documents from Elasticsearch. How can I achieve this? One solution is that I could write all the existing categories into an array. But I have more than 100 categories and this will…
1
vote
1 answer

How to create or update the search template of elasticsearch through Java code

I am using following elasticsearch query which I created using POST /_search/template/search through Postman { "template": { "query": { "bool": { "should": [ { "nested": { "path": "paymentAccounts", …
M Pankaj Arun
  • 84
  • 1
  • 8
1
vote
1 answer

Elastic search templates with partials

I am using Elasticsearch-7.4. I am trying to render a template with partials as per mustache document as follows GET _render/template { "source": "{ \"query\": { \"terms\": {{#toJson}}statuses{{/toJson}} }}{{>partial}}", "params": { …
Achaius
  • 5,904
  • 21
  • 65
  • 122
1
vote
2 answers

Index sorting Elasticsearch

Could Elasticsearch Template be used to do index sorting https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-index-sorting.html
1
vote
0 answers

Spring ElasticSearchTemplate UPDATE MultipleDocument

With Some Criteria or Query I would like to filter all ElasticSearch Documents and then Partial Update them I am looking for ElasticSearchTemplate Alternative for mongoTemplate.updateMulti(Query,Update,Class) Right now I am getting distinct IDs and…
Ashish
  • 1,856
  • 18
  • 30
1
2 3 4