Elasticsearch aggregate on URL hostname
问题 I am indexing documents with a field containing a url: [ 'myUrlField' => 'http://google.com/foo/bar' ] Now what I´d like to get out of elasticsearch is an aggregation on the url field. curl -XGET 'http://localhost:9200/myIndex/_search?pretty' -d '{ "facets": { "groupByMyUrlField": { "terms": { "field": "myUrlField" } } } }' This is all well and good, but the default analyzer tokenizes the field so that each part of the url is a token, so I get hits for http , google.com , foo and bar . But