# Match part of an URL

**URL:** <https://discuss.elastic.co/t/match-part-of-an-url/12357>\
**Category:** Elasticsearch\
**Created:** [June 11, 2013, 9:24am UTC](https://discuss.elastic.co/t/match-part-of-an-url/12357 "2013-06-11T09:24:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dp\_desoma](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@dp\_desoma](https://discuss.elastic.co/u/dp_desoma)\
**Post date:** [June 11, 2013, 9:24am UTC](https://discuss.elastic.co/t/match-part-of-an-url/12357/1 "2013-06-11T09:24:19Z")

</div>

Using ES 0.90.0 I've defined the following property:

```
"url": {
   "type": "string", 
   "boost": "0.5",
   "analyzer": "aurlemail",
   "index": "analyzed",
   "store": "yes"
},

```

and the analyzer looks like this:

```
index.analysis.analyzer.aurlemail:
  type: custom
  tokenizer: standard
  filter: lowercase, fngramurl
index.analysis.filter.fngramurl:
  type: nGram
  min_gram: 4
  max_gram: 10

```

I add documents with some URL's, like `http://www.google.com` and when I  
execute a query for `http://www.google.com` I get the ID's for the correct  
documents. But when searching just for `google` I get zero results.

I use Java, therefore I create the query like this:  
`QueryBuilders.queryString("google")`

I verified that the analyzer is working. when executing `curl -XGET 'localhost:9200/myindex/_analyze?analyzer=aurlemail' -d 'http://www.google.com'` I see the token `google`.

Why am I not getting the document in my result? What am I missing here?  
when doing the same with the attachment-mapping it works just fine

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:31am UTC](https://discuss.elastic.co/t/match-part-of-an-url/12357/2 "2017-07-06T02:31:51Z")

</div>


