# REST vs URL searching - what's the difference in this query?

**URL:** <https://discuss.elastic.co/t/rest-vs-url-searching-whats-the-difference-in-this-query/18647>\
**Category:** Elasticsearch\
**Created:** [July 14, 2014, 11:48am UTC](https://discuss.elastic.co/t/rest-vs-url-searching-whats-the-difference-in-this-query/18647 "2014-07-14T11:48:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmkgreen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jmkgreen/32/471_2.png) [@jmkgreen](https://discuss.elastic.co/u/jmkgreen)\
**Post date:** [July 14, 2014, 11:48am UTC](https://discuss.elastic.co/t/rest-vs-url-searching-whats-the-difference-in-this-query/18647/1 "2014-07-14T11:48:09Z")

</div>

This works in a browser and finds tens of thousands of records:

[http://localhost:9200/accountevents/\_search?q=Medium:SMS](http://localhost:9200/accountevents/_search?q=Medium:SMS)

This cmd finds nothing:

curl -XGET '[http://localhost:9200/accountevents/\_search](http://localhost:9200/accountevents/_search)' -d '{  
"query": {  
"term": {  
"Medium": "SMS"  
}  
}  
}'

We can't work out what the difference is. Can someone point it out to us?

Thanks,

James

--  
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/d4b85b87-8b79-4faa-82f1-d4706f1616e5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d4b85b87-8b79-4faa-82f1-d4706f1616e5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 14, 2014, 12:04pm UTC](https://discuss.elastic.co/t/rest-vs-url-searching-whats-the-difference-in-this-query/18647/2 "2014-07-14T12:04:06Z")

</div>

You are using a query\_string query in the first query, and a term query in  
the second query.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Instead of a term query you might want to use a match query, because this  
works on analyzed fields.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Jörg

On Mon, Jul 14, 2014 at 1:48 PM, James Green [james.mk.green@gmail.com](mailto:james.mk.green@gmail.com)  
wrote:

> This works in a browser and finds tens of thousands of records:
> 
> [http://localhost:9200/accountevents/\_search?q=Medium:SMS](http://localhost:9200/accountevents/_search?q=Medium:SMS)
> 
> This cmd finds nothing:
> 
> curl -XGET '[http://localhost:9200/accountevents/\_search](http://localhost:9200/accountevents/_search)' -d '{  
> "query": {  
> "term": {  
> "Medium": "SMS"  
> }  
> }  
> }'
> 
> We can't work out what the difference is. Can someone point it out to us?
> 
> Thanks,
> 
> James
> 
> --  
> 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/d4b85b87-8b79-4faa-82f1-d4706f1616e5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d4b85b87-8b79-4faa-82f1-d4706f1616e5%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/d4b85b87-8b79-4faa-82f1-d4706f1616e5%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d4b85b87-8b79-4faa-82f1-d4706f1616e5%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAKdsXoFuV6A%2BhjR543KBNz%3DzhVN84erxYppdJp9Mk25OVY77zg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFuV6A%2BhjR543KBNz%3DzhVN84erxYppdJp9Mk25OVY77zg%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/rest-vs-url-searching-whats-the-difference-in-this-query/18647/3 "2017-07-06T01:16:07Z")

</div>


