# Question about querying on a URL field

**URL:** <https://discuss.elastic.co/t/question-about-querying-on-a-url-field/18617>\
**Category:** Elasticsearch\
**Created:** [July 12, 2014, 2:06am UTC](https://discuss.elastic.co/t/question-about-querying-on-a-url-field/18617 "2014-07-12T02:06:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackpark](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jackpark](https://discuss.elastic.co/u/jackpark)\
**Post date:** [July 12, 2014, 2:06am UTC](https://discuss.elastic.co/t/question-about-querying-on-a-url-field/18617/1 "2014-07-12T02:06:05Z")

</div>

This query  
{"query":{"field":{"url":"[http://google.com/](http://google.com/)"}

seems to fail.  
It represents a stringified JSON object without any processing on the  
simple url itself.

A snippet of the giant error message is below.

Thanks in advance for ideas.  
Jack

DataProvider.getNodeByURL Error: {"error":"SearchPhaseExecutionException[Failed  
to execute phase [query], all shards failed; shardFailures {[p6M6zWBxReGkMx\_qcCV  
PDg][topics][2]: SearchParseException[[topics][2]: from[-1],size[-1]: Parse Fail  
ure [Failed to parse source [{"query":{"field":{"url":"[http://google.com/](http://google.com/)  
"}}}]]]; nested: QueryParsingException[[topics] Failed to parse query [[http://g](http://g)  
[oogle.com/](http://oogle.com/)]]; nested: ParseException[Cannot parse '[http://google.com/](http://google.com/)': Lexical  
error at line 1, column 19. Encountered: after : ""]; nested: TokenMgrE  
rror[Lexical error at line 1, column 19. Encountered: after : ""]; }{[p  
6M6zWBxReGkMx\_qcCVPDg][topics][3]: SearchParseException[[topics][3]: from[-1],si  
ze[-1]: Parse Failure [Failed to parse source [{"query":{"field":{"url":"  
[http://google.com/](http://google.com/)"}}}]]]; nested: QueryParsingException[[topics] Failed to par

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyga%2BveZH2cpbi\_gZN75ycSYdKwtw9xChoQHi0C71STFQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyga%2BveZH2cpbi_gZN75ycSYdKwtw9xChoQHi0C71STFQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jackpark](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jackpark](https://discuss.elastic.co/u/jackpark)\
**Post date:** [July 12, 2014, 4:47am UTC](https://discuss.elastic.co/t/question-about-querying-on-a-url-field/18617/2 "2014-07-12T04:47:20Z")

</div>

Exploring the web, I started applying a cleanup for special  
characters, plus hints from various answers, trying these queries:  
{"term":{"url":"http\:\/\/google.com\/"}}  
{"term":{"field":{"url":"http\:\/\/google.com\/"}}}  
{"term":{"search\_string":{"url":"http\:\/\/google.com\/"}}}

with no real difference.

On Fri, Jul 11, 2014 at 7:06 PM, Jack Park [jackpark@topicquests.org](mailto:jackpark@topicquests.org) wrote:

> This query  
> {"query":{"field":{"url":"[http://google.com/\](http://google.com/%5C)"}
> 
> seems to fail.  
> It represents a stringified JSON object without any processing on the  
> simple url itself.
> 
> A snippet of the giant error message is below.
> 
> Thanks in advance for ideas.  
> Jack
> 
> DataProvider.getNodeByURL Error: {"error":"SearchPhaseExecutionException[Failed  
> to execute phase [query], all shards failed; shardFailures {[p6M6zWBxReGkMx\_qcCV  
> PDg][topics][2]: SearchParseException[[topics][2]: from[-1],size[-1]: Parse Fail  
> ure [Failed to parse source [{"query":{"field":{"url":"[http://google.com/](http://google.com/)  
> "}}}]]]; nested: QueryParsingException[[topics] Failed to parse query [[http://g](http://g)  
> [oogle.com/](http://oogle.com/)]]; nested: ParseException[Cannot parse '[http://google.com/](http://google.com/)': Lexical  
> error at line 1, column 19. Encountered: after : ""]; nested: TokenMgrE  
> rror[Lexical error at line 1, column 19. Encountered: after : ""]; }{[p  
> 6M6zWBxReGkMx\_qcCVPDg][topics][3]: SearchParseException[[topics][3]: from[-1],si  
> ze[-1]: Parse Failure [Failed to parse source [{"query":{"field":{"url":"  
> [http://google.com/\](http://google.com/%5C)"}}}]]]; nested: QueryParsingException[[topics] Failed to par

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAH6s0fzew26GDbXvgYUz%2BQoRmrB-Hok-V7eZwxBMFCrph3kcnQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fzew26GDbXvgYUz%2BQoRmrB-Hok-V7eZwxBMFCrph3kcnQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:16am UTC](https://discuss.elastic.co/t/question-about-querying-on-a-url-field/18617/3 "2017-07-06T01:16:21Z")

</div>


