# Indexing and searching URLS with dashes

**URL:** <https://discuss.elastic.co/t/indexing-and-searching-urls-with-dashes/6977>\
**Category:** Elasticsearch\
**Created:** [March 13, 2012, 2:28pm UTC](https://discuss.elastic.co/t/indexing-and-searching-urls-with-dashes/6977 "2012-03-13T14:28:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_P](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_p/32/2962_2.png) [@Alex\_P](https://discuss.elastic.co/u/Alex_P)\
**Post date:** [March 13, 2012, 2:28pm UTC](https://discuss.elastic.co/t/indexing-and-searching-urls-with-dashes/6977/1 "2012-03-13T14:28:04Z")

</div>

Hi, here's a gist with a way to reproduce what I mention  
here: [https://gist.github.com/2029097](https://gist.github.com/2029097)

I'm trying to index domains (for instance, [produktion-naja.de](http://produktion-naja.de)), I before  
indexing urls, I get them through lowercase tokenizer and stop, ngram, and  
word delimiter filters.

Whenever I'm trying to search urls, when I have a dash in query, I get no  
search results. Whenever I replace dash with a whitespace, results come.

I'm not entirely sure what I am doing wrong here, everything seems to be  
more or less in place.

Thanks

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 14, 2012, 12:10pm UTC](https://discuss.elastic.co/t/indexing-and-searching-urls-with-dashes/6977/2 "2012-03-14T12:10:27Z")

</div>

Use text query instead of query\_string, or wrap it with "". Don't use wildcards (\*), it almost never a good idea to use it, and you already use ngrams.

On Tuesday, March 13, 2012 at 4:28 PM, Alex P wrote:

> Hi, here's a gist with a way to reproduce what I mention here: [https://gist.github.com/2029097](https://gist.github.com/2029097)
> 
> I'm trying to index domains (for instance, [produktion-naja.de](http://produktion-naja.de) ([http://produktion-naja.de](http://produktion-naja.de))), I before indexing urls, I get them through lowercase tokenizer and stop, ngram, and word delimiter filters.
> 
> Whenever I'm trying to search urls, when I have a dash in query, I get no search results. Whenever I replace dash with a whitespace, results come.
> 
> I'm not entirely sure what I am doing wrong here, everything seems to be more or less in place.
> 
> Thanks

---

<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:36am UTC](https://discuss.elastic.co/t/indexing-and-searching-urls-with-dashes/6977/3 "2017-07-06T03:36:14Z")

</div>


