2

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

Gordon
  • 312,688
  • 75
  • 539
  • 559
Alexander Schranz
  • 2,154
  • 2
  • 25
  • 42

1 Answers1

1

Escape the forward slash

"prefix": {
  "path": "\/cmf"
}
Adam Elsodaney
  • 7,722
  • 6
  • 39
  • 65