# Aliasing a faceted search?

**URL:** <https://discuss.elastic.co/t/aliasing-a-faceted-search/9169>\
**Category:** Elasticsearch\
**Created:** [September 27, 2012, 9:49am UTC](https://discuss.elastic.co/t/aliasing-a-faceted-search/9169 "2012-09-27T09:49:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antony\_Denyer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/antony_denyer/32/2701_2.png) [@Antony\_Denyer](https://discuss.elastic.co/u/Antony_Denyer)\
**Post date:** [September 27, 2012, 9:49am UTC](https://discuss.elastic.co/t/aliasing-a-faceted-search/9169/1 "2012-09-27T09:49:05Z")

</div>

Hi

We're currently using aliases as a filter on our main index. This works a  
treat.  
Through our api we provide our end users with a list of available facets by  
doing a faceted search with a match\_all.  
Is there a nicer way of doing this?

Essentially what I'd like to do is alias a type.  
For example aliasing the following:

curl -X POST "[http://localhost:9200/articles/\_search?pretty=true](http://localhost:9200/articles/_search?pretty=true)" -d '

> {
> 
> ```
> "size" : 0,
> "query" : { "query_string" : {"query" : "match_all"} },
> "facets" : {
> "tags" : { "terms" : {"field" : "tags"} }
> }
> 
> ```
> 
> }  
> '

with something like

curl "[http://localhost:9200/articles/tags](http://localhost:9200/articles/tags)

> 

Would be great if this kind of thing is available. If not any tips on doing  
things better are much appreciated.

Thanks

Antony

p.s keep up the great work Shay

--

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [September 28, 2012, 2:11pm UTC](https://discuss.elastic.co/t/aliasing-a-faceted-search/9169/2 "2012-09-28T14:11:27Z")

</div>

Antony Denyer wrote:

> We're currently using aliases as a filter on our main index. This  
> works a treat. Through our api we provide our end users with a  
> list of available facets by doing a faceted search with a  
> match\_all. Is there a nicer way of doing this?
> 
> Essentially what I'd like to do is alias a type. For example  
> aliasing the following:
> 
> curl -X POST "[http://localhost:9200/articles/\_search?pretty=true](http://localhost:9200/articles/_search?pretty=true)" -d '
> 
> > {
> > 
> > ```
> > "size" : 0,
> > "query" : { "query_string" : {"query" : "match_all"} },
> > "facets" : {
> > "tags" : { "terms" : {"field" : "tags"} }
> > }
> > 
> > ```
> > 
> > }  
> > '
> 
> with something like
> 
> curl "[http://localhost:9200/articles/tags](http://localhost:9200/articles/tags)

Aliases only operate at the index position of the URI. You could  
write a plugin to register a GET handler for /:index/:type, which is  
currently unused, to accomplish this.

-Drew

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:10am UTC](https://discuss.elastic.co/t/aliasing-a-faceted-search/9169/3 "2017-07-06T03:10:52Z")

</div>

Closed on July 6, 2017, 3:10am UTC


