Elasticsearch Prefixfilter special character not working

403 Views Asked by At

I used ongr-elasticsearch bundle in php and wanted to add a PrefixFilter. When I add a slash at the front of the prefix it dont work. Here the query I build in ElasticSearch HQ Plugin:

{
  "query": {
    "filtered": {
      "filter": {
        "prefix": {
          "path": "/cmf"
        }
      }
    }
  }
}

EDIT:

FXIED: need to use an custom pathAnalyzer to use queries

1

There are 1 best solutions below

1
On

Escape the forward slash

"prefix": {
  "path": "\/cmf"
}