# Filtering by URL tokens

**URL:** <https://discuss.elastic.co/t/filtering-by-url-tokens/32290>\
**Category:** Elasticsearch\
**Created:** [October 15, 2015, 3:17pm UTC](https://discuss.elastic.co/t/filtering-by-url-tokens/32290 "2015-10-15T15:17:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danny\_Kidron](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@Danny\_Kidron](https://discuss.elastic.co/u/Danny_Kidron)\
**Post date:** [October 15, 2015, 3:17pm UTC](https://discuss.elastic.co/t/filtering-by-url-tokens/32290/1 "2015-10-15T15:17:05Z")

</div>

I would like to be able to use elasticsearch in order to filter entities based on a URL field.  
The input is in terms of tokens, such as '[http://www.cnn.com/](http://www.cnn.com/)' or '[cnn.com/politics](http://cnn.com/politics)' and I should be able to filter out entities whose URL contains these tokens.  
I can assume that these tokens will always contain the domain name (though possibly without 'www') and therefore I can use the prefix filter.  
How does the prefix filter perform? Do I need to mark the field as unanalyzed when indexing it?  
What other options do I have?

---

<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 5, 2017, 11:44pm UTC](https://discuss.elastic.co/t/filtering-by-url-tokens/32290/2 "2017-07-05T23:44:34Z")

</div>


