0

Very new to elasticsearch, using the Java client.

Is it possible to return facet counts filtered on a prefix?

For example, I'm searching for URLs and want to ignore the path, and just count the hostname. Eg,

addFacet( filterFacet("myhost", prefixFilter("url", "http://myhost.com"))

In the response the facets are all empty. No names or values.

Andy Hume
  • 40,474
  • 10
  • 47
  • 58

1 Answers1

1

The best solution would be to store the part that you want to facet on as a separate field. Alternatively, you can use Term Scripts to extract the prefix on the fly.

imotov
  • 28,277
  • 3
  • 90
  • 82