# A query I believe should work, doesn't seem to

**URL:** <https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837>\
**Category:** Elasticsearch\
**Created:** [March 4, 2010, 6:27pm UTC](https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837 "2010-03-04T18:27:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_O\_Neill](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@Daniel\_O\_Neill](https://discuss.elastic.co/u/Daniel_O_Neill)\
**Post date:** [March 4, 2010, 6:27pm UTC](https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837/1 "2010-03-04T18:27:47Z")

</div>

I've loaded an ES instance with some sample data and while the queries  
in the documentation seem to work, I'm missing something when I try to  
get the same queries to work against my data.

This query does not return any results:

curl -XGET localhost:9200/music/song/\_search?q=artist:"Quarashi"

Here is how I loaded the data:

curl -XPOST [http://localhost:9200/music/song](http://localhost:9200/music/song) -d '  
{  
song\_id : "00000000000000009771",  
title : "Malone Lives",  
version : "Clean Version",  
artist : "Quarashi",  
year : "2002",  
genre : "Pop",  
label : "Time Bomb Recordings",  
album\_title : ""  
}'

Sorry for the rather simply question, I'll ask more interesting  
questions as I get further into this project.

Dan

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 4, 2010, 6:38pm UTC](https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837/2 "2010-03-04T18:38:52Z")

</div>

On Thu, 2010-03-04 at 10:27 -0800, Daniel O'Neill wrote:

> I've loaded an ES instance with some sample data and while the queries  
> in the documentation seem to work, I'm missing something when I try to  
> get the same queries to work against my data.
> 
> This query does not return any results:
> 
> curl -XGET localhost:9200/music/song/\_search?q=artist:"Quarashi"

It works for me, are you using the latest version from git?

clint

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Daniel\_O\_Neill](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@Daniel\_O\_Neill](https://discuss.elastic.co/u/Daniel_O_Neill)\
**Post date:** [March 4, 2010, 6:57pm UTC](https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837/3 "2010-03-04T18:57:54Z")

</div>

Version: elasticsearch-0.4.0  
not from git.

Here's the actual transcript:

$ curl -XPOST [http://localhost:9200/music/song](http://localhost:9200/music/song) -d '

> {  
> song\_id : "00000000000000009771",  
> title : "Malone Lives",  
> version : "Clean Version",  
> artist : "Quarashi",  
> year : "2002",  
> genre : "Pop",  
> label : "Time Bomb Recordings",  
> album\_title : ""
> 
> }'  
> {"ok":true,"\_index":"music","\_type":"song","\_id":"7520c46e-5951-4a8c-88ec-8bdca9e2a849"}

$ curl -XGET localhost:9200/music/song/\_search?q=artist:"Quarashi"  
{"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":  
0,"hits":}}

While this query does work:

$ curl -XGET localhost:9200/music/song/\_search?q=year:"2002"  
{"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":  
1,"hits":  
[{"\_index":"music","\_type":"song","\_id":"7520c46e-5951-4a8c-88ec-8bdca9e2a849",  
"\_source" :  
{  
song\_id : "00000000000000009771",  
title : "Malone Lives",  
version : "Clean Version",  
artist : "Quarashi",  
year : "2002",  
genre : "Pop",  
label : "Time Bomb Recordings",  
album\_title : ""

}}]}}

On Mar 4, 10:38 am, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> It works for me, are you using the latest version from git?
> 
> clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 4, 2010, 7:07pm UTC](https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837/4 "2010-03-04T19:07:53Z")

</div>

On Thu, 2010-03-04 at 10:57 -0800, Daniel O'Neill wrote:

> Version: elasticsearch-0.4.0  
> not from git.

ï»¿Not knowing anything about the internals, I'd say it is likely that  
this has something to do with bugs that existed in mapping.

A lot has changed in the latest version from github, a lot of bugs have  
been fixed. I would recommend using it over the 0.4 release.

It's dead easy to compile. On linux, you'd do something like this:

```
cd ~
git clone git://github.com/elasticsearch/elasticsearch.git
cd elasticsearch
./gradlew

cd /path/where/you/want/elasticsearch
unzip ~/elasticsearch/distributions/elasticsearch*

```

hth

clint

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Daniel\_O\_Neill](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@Daniel\_O\_Neill](https://discuss.elastic.co/u/Daniel_O_Neill)\
**Post date:** [March 4, 2010, 7:41pm UTC](https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837/5 "2010-03-04T19:41:44Z")

</div>

Since I'm just going through getting all this stuff to work on an  
Ubuntu 9.10 system, I may as well document some of the packages that  
aren't installed by default that are needed for elasticsearch

apt-get install curl  
apt-get install sun-java6-bin  
apt-get install sun-java6-jdk  
apt-get install git-core

(I may have missed a few packages, but the above should get things  
going)

The build instructions are great, just one minor bug, in the unzip  
line:

cd ~  
git clone git://github.com/elasticsearch/elasticsearch.git  
cd elasticsearch  
./gradlew

cd /path/where/you/want/elasticsearch  
unzip ~/elasticsearch/build/distributions/elasticsearch\*

Version 0.5.0-SNAPSHOT fixes the problem I presented earlier. Clinton,  
thank you very much for your help.

Dan

On Mar 4, 11:07 am, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> On Thu, 2010-03-04 at 10:57 -0800, Daniel O'Neill wrote:
> 
> > Version: elasticsearch-0.4.0  
> > not from git.
> 
> Not knowing anything about the internals, I'd say it is likely that  
> this has something to do with bugs that existed in mapping.
> 
> A lot has changed in the latest version from github, a lot of bugs have  
> been fixed. I would recommend using it over the 0.4 release.
> 
> It's dead easy to compile. On linux, you'd do something like this:
> 
> ```
> cd ~
> git clone git://github.com/elasticsearch/elasticsearch.git
> cd elasticsearch
> ./gradlew
> 
> cd /path/where/you/want/elasticsearch
> unzip ~/elasticsearch/distributions/elasticsearch*
> 
> ```
> 
> hth
> 
> clint
> 
> --  
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 4, 2010, 7:45pm UTC](https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837/6 "2010-03-04T19:45:37Z")

</div>

> The build instructions are great, just one minor bug, in the unzip  
> line:

thanks for spotting that

## clint

Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<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 4, 2010, 8:18pm UTC](https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837/7 "2010-03-04T20:18:22Z")

</div>

Yea, current master is much more stable than 0.4. Expect 0.5 to be released  
any day... .

-shay.banon

On Thu, Mar 4, 2010 at 9:45 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> > The build instructions are great, just one minor bug, in the unzip  
> > line:
> 
> thanks for spotting that
> 
> ## clint
> 
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<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, 4:25am UTC](https://discuss.elastic.co/t/a-query-i-believe-should-work-doesnt-seem-to/2837/8 "2017-07-06T04:25:27Z")

</div>


