# Cannot search URL

**URL:** <https://discuss.elastic.co/t/cannot-search-url/6047>\
**Category:** Elasticsearch\
**Created:** [December 2, 2011, 4:43am UTC](https://discuss.elastic.co/t/cannot-search-url/6047 "2011-12-02T04:43:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene\_Strokin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eugene_strokin/32/1238_2.png) [@Eugene\_Strokin](https://discuss.elastic.co/u/Eugene_Strokin)\
**Post date:** [December 2, 2011, 4:43am UTC](https://discuss.elastic.co/t/cannot-search-url/6047/1 "2011-12-02T04:43:41Z")

</div>

I have a field mapped like this:

"linkImgUrl":{"type":"string", index:"not\_analyzed"}

I've indexed a document, and set this value to, for example, this  
string:

[![](https://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy_of_Happiness.png) ](https://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy_of_Happiness.png)

If I search by this value, I don't have this document returned.

What could be possibly wrong?  
I have another such field with the same mapping, but simple string  
value, and I can search the document by that value. Only URL like  
string doesn't work

Thank you,  
Eugene S.

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [December 2, 2011, 8:56pm UTC](https://discuss.elastic.co/t/cannot-search-url/6047/2 "2011-12-02T20:56:24Z")

</div>

you need to confirm that the mapping gets actually applied. Because  
all string values are searchable per default. so, that the simple  
string is 'working' does not mean that the mapping is known to ES.

Is the type correct for the mapping? is the location correct of the  
file or if you use the API (you should! :)) this wouldn't be a  
problem.  
Also you should post the query. Are you doing a term query?

Regards,  
Peter.

On 2 Dez., 05:43, Eugene Strokin [eug...@strokin.info](mailto:eug...@strokin.info) wrote:

> I have a field mapped like this:
> 
> "linkImgUrl":{"type":"string", index:"not\_analyzed"}
> 
> I've indexed a document, and set this value to, for example, this  
> string:
> 
> [http://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy\_of\_Happine](http://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy_of_Happine)...
> 
> If I search by this value, I don't have this document returned.
> 
> What could be possibly wrong?  
> I have another such field with the same mapping, but simple string  
> value, and I can search the document by that value. Only URL like  
> string doesn't work
> 
> Thank you,  
> Eugene S.

---

<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:** [December 4, 2011, 2:44pm UTC](https://discuss.elastic.co/t/cannot-search-url/6047/3 "2011-12-04T14:44:25Z")

</div>

Not sure what wrong, and hard to help without an example of the most basic  
things, like how do you search? Also, validate that your mapping are  
actually set using get mappings. And, if things do not work, a simple  
recreation works best. Here is an example that shows that it works:  
[gist:1430356 · GitHub](https://gist.github.com/1430356).

On Fri, Dec 2, 2011 at 6:43 AM, Eugene Strokin [eugene@strokin.info](mailto:eugene@strokin.info) wrote:

> I have a field mapped like this:
> 
> "linkImgUrl":{"type":"string", index:"not\_analyzed"}
> 
> I've indexed a document, and set this value to, for example, this  
> string:
> 
> [http://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy\_of\_Happiness.png](http://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy_of_Happiness.png)
> 
> If I search by this value, I don't have this document returned.
> 
> What could be possibly wrong?  
> I have another such field with the same mapping, but simple string  
> value, and I can search the document by that value. Only URL like  
> string doesn't work
> 
> Thank you,  
> Eugene S.

---

<div class="post-metadata">

**Author:** ![Andrej](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Andrej](https://discuss.elastic.co/u/Andrej)\
**Post date:** [December 5, 2011, 10:03am UTC](https://discuss.elastic.co/t/cannot-search-url/6047/4 "2011-12-05T10:03:47Z")

</div>

Don't know if there is a logical explanation for this, but we  
encountered problems like this quite often when using capitol  
letters.  
Just as a guess, try converting your search string to lower case, at  
least for us this solves a lot of problems.

Andrej

On 2 Dez., 05:43, Eugene Strokin [eug...@strokin.info](mailto:eug...@strokin.info) wrote:

> I have a field mapped like this:
> 
> "linkImgUrl":{"type":"string", index:"not\_analyzed"}
> 
> I've indexed a document, and set this value to, for example, this  
> string:
> 
> [http://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy\_of\_Happine](http://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy_of_Happine)...
> 
> If I search by this value, I don't have this document returned.
> 
> What could be possibly wrong?  
> I have another such field with the same mapping, but simple string  
> value, and I can search the document by that value. Only URL like  
> string doesn't work
> 
> Thank you,  
> Eugene S.

---

<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:** [December 5, 2011, 7:21pm UTC](https://discuss.elastic.co/t/cannot-search-url/6047/5 "2011-12-05T19:21:31Z")

</div>

When the field is not analyzed, then you have to use the exact casing to  
search against it. You can create a custom analyzer that has a keyword  
tokenizer and lowercase filter to keep it from being broken down into  
multiple tokens, but still lowercasing it.

On Mon, Dec 5, 2011 at 12:03 PM, Andrej Rosenheinrich \<  
[andrej.rosenheinrich@unister.de](mailto:andrej.rosenheinrich@unister.de)\> wrote:

> Don't know if there is a logical explanation for this, but we  
> encountered problems like this quite often when using capitol  
> letters.  
> Just as a guess, try converting your search string to lower case, at  
> least for us this solves a lot of problems.
> 
> Andrej
> 
> On 2 Dez., 05:43, Eugene Strokin [eug...@strokin.info](mailto:eug...@strokin.info) wrote:
> 
> > I have a field mapped like this:
> > 
> > "linkImgUrl":{"type":"string", index:"not\_analyzed"}
> > 
> > I've indexed a document, and set this value to, for example, this  
> > string:
> > 
> > [http://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy\_of\_Happine](http://upload.wikimedia.org/wikipedia/commons/0/03/Alchemy_of_Happine)...
> > 
> > If I search by this value, I don't have this document returned.
> > 
> > What could be possibly wrong?  
> > I have another such field with the same mapping, but simple string  
> > value, and I can search the document by that value. Only URL like  
> > string doesn't work
> > 
> > Thank you,  
> > Eugene S.

---

<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:46am UTC](https://discuss.elastic.co/t/cannot-search-url/6047/6 "2017-07-06T03:46:22Z")

</div>


