How can we percolate with dynamic fields?

Having a similar problem/question as Percolators and Dynamic templates though that got closed without any replies.

Our use case:

We have products with various dynamic properties, saved as ranges or numeric values. Our mapping is set up with a dynamic template to allow for growth and not having to worry about every single property any product could have.
Based on this, we have filters that could display products that would match the given properties.

Now we want to percolate, and are a bit slowed down by the issue that Elasticsearch 5.5 and up, no longer allows percolating against dynamic fields (the percolator doesn't add these fields anymore to it's own mapping).

Is there a way to still have a dynamic template in the source, without having to put the end result in the percolate mapping every time a new property is being created?

Example mapping

 {
  "product_percolator_nl_1_10_1531119901539": {
    "mappings": {
      "product": {
        "dynamic_templates": [
          {
            "numeric_facets": {
              "path_match": "numericFacets.*",
              "mapping": {
                "type": "double"
              }
            }
          }
        ],
        "properties": {
          "id": {
            "type": "keyword",
            "index": false
          },
          "query": {
            "properties": {
              "bool": {
                "properties": {
                  "filter": {
                    "properties": {
                      "term": {
                        "properties": {
                          "optionFacets": {
                            "type": "text",
                            "fields": {
                              "keyword": {
                                "type": "keyword",
                                "ignore_above": 256
                              }
                            }
                          }
                        }
                      },
                      "terms": {
                        "properties": {
                          "numericFacets": {
                            "type": "text",
                            "fields": {
                              "keyword": {
                                "type": "keyword",
                                "ignore_above": 256
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Really looking for some help, since manually updating the mapping isn't really a viable solution.

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