# Query not working

**URL:** <https://discuss.elastic.co/t/query-not-working/8047>\
**Category:** Elasticsearch\
**Created:** [June 11, 2012, 10:22pm UTC](https://discuss.elastic.co/t/query-not-working/8047 "2012-06-11T22:22:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warner\_Onstine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warner_onstine/32/1086_2.png) [@Warner\_Onstine](https://discuss.elastic.co/u/Warner_Onstine)\
**Post date:** [June 11, 2012, 10:22pm UTC](https://discuss.elastic.co/t/query-not-working/8047/1 "2012-06-11T22:22:10Z")

</div>

Confused as to why a very simple query isn't working. I think I have  
everything setup correctly, but have been having difficulty trying to  
figure out if it's functioning the way it should.

Here's my setup:

- Couchdb
- Couchdb river and index setup
- Mappings for my objects

When I run my query (which should at least return one result) I get this:  
curl -XGET '[http://localhost:9200/syncrswim/Event/\_search?q=title:teach](http://localhost:9200/syncrswim/Event/_search?q=title:teach)'

{"took":1,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":[]}}

Here's my mapping for said object:  
curl -XGET '[http://localhost:9200/syncrswim/Event/\_mapping](http://localhost:9200/syncrswim/Event/_mapping)'  
{"Event":{"properties":{"description":{"type":"string","store":"yes"},"title":{"type":"string","store":"yes"}}}}

and here's my river:  
curl -XGET '[http://localhost:9200/\_river/syncrswim/\_meta](http://localhost:9200/_river/syncrswim/_meta)'  
{"\_index":"\_river","\_type":"syncrswim","\_id":"\_meta","exists":false}

And my index  
curl -XGET '[http://localhost:9200/syncrswim/\_status](http://localhost:9200/syncrswim/_status)'  
{"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97},"shards":{"0":[{"routing":{"state":"STARTED","primary":true,"node":"YYRIHgGwTIS\_SBvoA4u\_SQ","relocating\_node":null,"shard":0,"index":"syncrswim"},"state":"STARTED","index":{"size":"98.9kb","size\_in\_bytes":101373},"translog":{"id":1339435624749,"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97}}]}}}}

Looking at this section:  
{"num\_docs":24,"max\_doc":24,"deleted\_docs":0}

Which is the correct number of docs.

Any ideas on why my query isn't returning anything? Thank you :-).

-warner

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 11, 2012, 10:38pm UTC](https://discuss.elastic.co/t/query-not-working/8047/2 "2012-06-11T22:38:19Z")

</div>

Silly question, but does your index have a document with teach in the  
title? 🙂 You did not provide an example of a document. Since your  
index is small, you can simply search for all documents:

curl -XGET '[http://localhost:9200/syncrswim/Event/\_search?q=\*:\*&size=25](http://localhost:9200/syncrswim/Event/_search?q=*:*&size=25)

Perhaps you simply do not have such a document.

--  
Ivan

On Mon, Jun 11, 2012 at 3:22 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com) wrote:

> Confused as to why a very simple query isn't working. I think I have  
> everything setup correctly, but have been having difficulty trying to  
> figure out if it's functioning the way it should.
> 
> Here's my setup:
> 
> - Couchdb
> - Couchdb river and index setup
> - Mappings for my objects
> 
> When I run my query (which should at least return one result) I get this:  
> curl -XGET '[http://localhost:9200/syncrswim/Event/\_search?q=title:teach](http://localhost:9200/syncrswim/Event/_search?q=title:teach)'
> 
> {"took":1,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> 
> Here's my mapping for said object:  
> curl -XGET '[http://localhost:9200/syncrswim/Event/\_mapping](http://localhost:9200/syncrswim/Event/_mapping)'  
> {"Event":{"properties":{"description":{"type":"string","store":"yes"},"title":{"type":"string","store":"yes"}}}}
> 
> and here's my river:  
> curl -XGET '[http://localhost:9200/\_river/syncrswim/\_meta](http://localhost:9200/_river/syncrswim/_meta)'  
> {"\_index":"\_river","\_type":"syncrswim","\_id":"\_meta","exists":false}
> 
> And my index  
> curl -XGET '[http://localhost:9200/syncrswim/\_status](http://localhost:9200/syncrswim/_status)'  
> {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97},"shards":{"0":[{"routing":{"state":"STARTED","primary":true,"node":"YYRIHgGwTIS\_SBvoA4u\_SQ","relocating\_node":null,"shard":0,"index":"syncrswim"},"state":"STARTED","index":{"size":"98.9kb","size\_in\_bytes":101373},"translog":{"id":1339435624749,"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97}}]}}}}
> 
> Looking at this section:  
> {"num\_docs":24,"max\_doc":24,"deleted\_docs":0}
> 
> Which is the correct number of docs.
> 
> Any ideas on why my query isn't returning anything? Thank you :-).
> 
> -warner

---

<div class="post-metadata">

**Author:** ![Warner\_Onstine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warner_onstine/32/1086_2.png) [@Warner\_Onstine](https://discuss.elastic.co/u/Warner_Onstine)\
**Post date:** [June 11, 2012, 10:40pm UTC](https://discuss.elastic.co/t/query-not-working/8047/3 "2012-06-11T22:40:41Z")

</div>

Uh, yeah I do have a doc with that in the title :P.

Oh, and if I do something like this:  
curl -XGET 'localhost:9200/syncrswim/\_search' -d '{"query" :  
{"match\_all" : {}}}'

I do get the docs back:  
{"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0}  
...

And i do see the doc I'm trying to get back in that result set.

but if I try and do a search on /Event/\_search I get 0 back. Confused.

And If I try moving it up a level to:  
curl -XGET '[http://localhost:9200/syncrswim/\_search?q=title:teach](http://localhost:9200/syncrswim/_search?q=title:teach)'{"took":189,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}

I get 0 back again.

-warner

On Mon, Jun 11, 2012 at 3:38 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> Silly question, but does your index have a document with teach in the  
> title? 🙂 You did not provide an example of a document. Since your  
> index is small, you can simply search for all documents:
> 
> curl -XGET '[http://localhost:9200/syncrswim/Event/\_search?q=\*:\*&size=25](http://localhost:9200/syncrswim/Event/_search?q=*:*&size=25)
> 
> Perhaps you simply do not have such a document.
> 
> --  
> Ivan
> 
> On Mon, Jun 11, 2012 at 3:22 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com) wrote:
> 
> > Confused as to why a very simple query isn't working. I think I have  
> > everything setup correctly, but have been having difficulty trying to  
> > figure out if it's functioning the way it should.
> > 
> > Here's my setup:
> > 
> > - Couchdb
> > - Couchdb river and index setup
> > - Mappings for my objects
> > 
> > When I run my query (which should at least return one result) I get this:  
> > curl -XGET '[http://localhost:9200/syncrswim/Event/\_search?q=title:teach](http://localhost:9200/syncrswim/Event/_search?q=title:teach)'
> > 
> > {"took":1,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> > 
> > Here's my mapping for said object:  
> > curl -XGET '[http://localhost:9200/syncrswim/Event/\_mapping](http://localhost:9200/syncrswim/Event/_mapping)'  
> > {"Event":{"properties":{"description":{"type":"string","store":"yes"},"title":{"type":"string","store":"yes"}}}}
> > 
> > and here's my river:  
> > curl -XGET '[http://localhost:9200/\_river/syncrswim/\_meta](http://localhost:9200/_river/syncrswim/_meta)'  
> > {"\_index":"\_river","\_type":"syncrswim","\_id":"\_meta","exists":false}
> > 
> > And my index  
> > curl -XGET '[http://localhost:9200/syncrswim/\_status](http://localhost:9200/syncrswim/_status)'  
> > {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97},"shards":{"0":[{"routing":{"state":"STARTED","primary":true,"node":"YYRIHgGwTIS\_SBvoA4u\_SQ","relocating\_node":null,"shard":0,"index":"syncrswim"},"state":"STARTED","index":{"size":"98.9kb","size\_in\_bytes":101373},"translog":{"id":1339435624749,"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97}}]}}}}
> > 
> > Looking at this section:  
> > {"num\_docs":24,"max\_doc":24,"deleted\_docs":0}
> > 
> > Which is the correct number of docs.
> > 
> > Any ideas on why my query isn't returning anything? Thank you :-).
> > 
> > -warner

---

<div class="post-metadata">

**Author:** ![Warner\_Onstine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warner_onstine/32/1086_2.png) [@Warner\_Onstine](https://discuss.elastic.co/u/Warner_Onstine)\
**Post date:** [June 11, 2012, 10:43pm UTC](https://discuss.elastic.co/t/query-not-working/8047/4 "2012-06-11T22:43:41Z")

</div>

Ok, weird. I just tried a different title that I could for sure see in  
the output above and I get it back. Hmm

curl -XGET '[http://localhost:9200/syncrswim/\_search?q=title:Course](http://localhost:9200/syncrswim/_search?q=title:Course)'  
{"took":41,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":2,"max\_score":1.3472557,  
...

So, not sure why it isn't finding a similar doc (that is in my couchdb  
and should also be in my ES instance).

Will dig further and see if I can figure this out.

-warner

On Mon, Jun 11, 2012 at 3:40 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com) wrote:

> Uh, yeah I do have a doc with that in the title :P.
> 
> Oh, and if I do something like this:  
> curl -XGET 'localhost:9200/syncrswim/\_search' -d '{"query" :  
> {"match\_all" : {}}}'
> 
> I do get the docs back:  
> {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0}  
> ...
> 
> And i do see the doc I'm trying to get back in that result set.
> 
> but if I try and do a search on /Event/\_search I get 0 back. Confused.
> 
> And If I try moving it up a level to:  
> curl -XGET '[http://localhost:9200/syncrswim/\_search?q=title:teach](http://localhost:9200/syncrswim/_search?q=title:teach)'{"took":189,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> 
> I get 0 back again.
> 
> -warner
> 
> On Mon, Jun 11, 2012 at 3:38 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > Silly question, but does your index have a document with teach in the  
> > title? 🙂 You did not provide an example of a document. Since your  
> > index is small, you can simply search for all documents:
> > 
> > curl -XGET '[http://localhost:9200/syncrswim/Event/\_search?q=\*:\*&size=25](http://localhost:9200/syncrswim/Event/_search?q=*:*&size=25)
> > 
> > Perhaps you simply do not have such a document.
> > 
> > --  
> > Ivan
> > 
> > On Mon, Jun 11, 2012 at 3:22 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com) wrote:
> > 
> > > Confused as to why a very simple query isn't working. I think I have  
> > > everything setup correctly, but have been having difficulty trying to  
> > > figure out if it's functioning the way it should.
> > > 
> > > Here's my setup:
> > > 
> > > - Couchdb
> > > - Couchdb river and index setup
> > > - Mappings for my objects
> > > 
> > > When I run my query (which should at least return one result) I get this:  
> > > curl -XGET '[http://localhost:9200/syncrswim/Event/\_search?q=title:teach](http://localhost:9200/syncrswim/Event/_search?q=title:teach)'
> > > 
> > > {"took":1,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> > > 
> > > Here's my mapping for said object:  
> > > curl -XGET '[http://localhost:9200/syncrswim/Event/\_mapping](http://localhost:9200/syncrswim/Event/_mapping)'  
> > > {"Event":{"properties":{"description":{"type":"string","store":"yes"},"title":{"type":"string","store":"yes"}}}}
> > > 
> > > and here's my river:  
> > > curl -XGET '[http://localhost:9200/\_river/syncrswim/\_meta](http://localhost:9200/_river/syncrswim/_meta)'  
> > > {"\_index":"\_river","\_type":"syncrswim","\_id":"\_meta","exists":false}
> > > 
> > > And my index  
> > > curl -XGET '[http://localhost:9200/syncrswim/\_status](http://localhost:9200/syncrswim/_status)'  
> > > {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97},"shards":{"0":[{"routing":{"state":"STARTED","primary":true,"node":"YYRIHgGwTIS\_SBvoA4u\_SQ","relocating\_node":null,"shard":0,"index":"syncrswim"},"state":"STARTED","index":{"size":"98.9kb","size\_in\_bytes":101373},"translog":{"id":1339435624749,"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97}}]}}}}
> > > 
> > > Looking at this section:  
> > > {"num\_docs":24,"max\_doc":24,"deleted\_docs":0}
> > > 
> > > Which is the correct number of docs.
> > > 
> > > Any ideas on why my query isn't returning anything? Thank you :-).
> > > 
> > > -warner

---

<div class="post-metadata">

**Author:** ![Warner\_Onstine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warner_onstine/32/1086_2.png) [@Warner\_Onstine](https://discuss.elastic.co/u/Warner_Onstine)\
**Post date:** [June 11, 2012, 10:46pm UTC](https://discuss.elastic.co/t/query-not-working/8047/5 "2012-06-11T22:46:22Z")

</div>

Oh, I know what it is now. The title was:  
Teacher Training Program: Level 2 – Understanding Your World

It finds teacher and understanding, but it won't find "understand".

Config issue of some type?

-warner

On Mon, Jun 11, 2012 at 3:43 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com) wrote:

> Ok, weird. I just tried a different title that I could for sure see in  
> the output above and I get it back. Hmm
> 
> curl -XGET '[http://localhost:9200/syncrswim/\_search?q=title:Course](http://localhost:9200/syncrswim/_search?q=title:Course)'  
> {"took":41,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":2,"max\_score":1.3472557,  
> ...
> 
> So, not sure why it isn't finding a similar doc (that is in my couchdb  
> and should also be in my ES instance).
> 
> Will dig further and see if I can figure this out.
> 
> -warner
> 
> On Mon, Jun 11, 2012 at 3:40 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com) wrote:
> 
> > Uh, yeah I do have a doc with that in the title :P.
> > 
> > Oh, and if I do something like this:  
> > curl -XGET 'localhost:9200/syncrswim/\_search' -d '{"query" :  
> > {"match\_all" : {}}}'
> > 
> > I do get the docs back:  
> > {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0}  
> > ...
> > 
> > And i do see the doc I'm trying to get back in that result set.
> > 
> > but if I try and do a search on /Event/\_search I get 0 back. Confused.
> > 
> > And If I try moving it up a level to:  
> > curl -XGET '[http://localhost:9200/syncrswim/\_search?q=title:teach](http://localhost:9200/syncrswim/_search?q=title:teach)'{"took":189,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> > 
> > I get 0 back again.
> > 
> > -warner
> > 
> > On Mon, Jun 11, 2012 at 3:38 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> > 
> > > Silly question, but does your index have a document with teach in the  
> > > title? 🙂 You did not provide an example of a document. Since your  
> > > index is small, you can simply search for all documents:
> > > 
> > > curl -XGET '[http://localhost:9200/syncrswim/Event/\_search?q=\*:\*&size=25](http://localhost:9200/syncrswim/Event/_search?q=*:*&size=25)
> > > 
> > > Perhaps you simply do not have such a document.
> > > 
> > > --  
> > > Ivan
> > > 
> > > On Mon, Jun 11, 2012 at 3:22 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com) wrote:
> > > 
> > > > Confused as to why a very simple query isn't working. I think I have  
> > > > everything setup correctly, but have been having difficulty trying to  
> > > > figure out if it's functioning the way it should.
> > > > 
> > > > Here's my setup:
> > > > 
> > > > - Couchdb
> > > > - Couchdb river and index setup
> > > > - Mappings for my objects
> > > > 
> > > > When I run my query (which should at least return one result) I get this:  
> > > > curl -XGET '[http://localhost:9200/syncrswim/Event/\_search?q=title:teach](http://localhost:9200/syncrswim/Event/_search?q=title:teach)'
> > > > 
> > > > {"took":1,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> > > > 
> > > > Here's my mapping for said object:  
> > > > curl -XGET '[http://localhost:9200/syncrswim/Event/\_mapping](http://localhost:9200/syncrswim/Event/_mapping)'  
> > > > {"Event":{"properties":{"description":{"type":"string","store":"yes"},"title":{"type":"string","store":"yes"}}}}
> > > > 
> > > > and here's my river:  
> > > > curl -XGET '[http://localhost:9200/\_river/syncrswim/\_meta](http://localhost:9200/_river/syncrswim/_meta)'  
> > > > {"\_index":"\_river","\_type":"syncrswim","\_id":"\_meta","exists":false}
> > > > 
> > > > And my index  
> > > > curl -XGET '[http://localhost:9200/syncrswim/\_status](http://localhost:9200/syncrswim/_status)'  
> > > > {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97},"shards":{"0":[{"routing":{"state":"STARTED","primary":true,"node":"YYRIHgGwTIS\_SBvoA4u\_SQ","relocating\_node":null,"shard":0,"index":"syncrswim"},"state":"STARTED","index":{"size":"98.9kb","size\_in\_bytes":101373},"translog":{"id":1339435624749,"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97}}]}}}}
> > > > 
> > > > Looking at this section:  
> > > > {"num\_docs":24,"max\_doc":24,"deleted\_docs":0}
> > > > 
> > > > Which is the correct number of docs.
> > > > 
> > > > Any ideas on why my query isn't returning anything? Thank you :-).
> > > > 
> > > > -warner

---

<div class="post-metadata">

**Author:** ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)\
**Post date:** [June 12, 2012, 7:35am UTC](https://discuss.elastic.co/t/query-not-working/8047/6 "2012-06-12T07:35:37Z")

</div>

You should adapt the mapping of the document type "Event"

The following pages may help you:

> **[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.

> **[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.

-- Tanguy

Le mardi 12 juin 2012 00:46:22 UTC+2, warnero a écrit :

> Oh, I know what it is now. The title was:  
> Teacher Training Program: Level 2 – Understanding Your World
> 
> It finds teacher and understanding, but it won't find "understand".
> 
> Config issue of some type?
> 
> -warner
> 
> On Mon, Jun 11, 2012 at 3:43 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com)  
> wrote:
> 
> > Ok, weird. I just tried a different title that I could for sure see in  
> > the output above and I get it back. Hmm
> > 
> > curl -XGET '[http://localhost:9200/syncrswim/\_search?q=title:Course](http://localhost:9200/syncrswim/_search?q=title:Course)'
> 
> {"took":41,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":2,"max\_score":1.3472557,
> 
> > ...
> > 
> > So, not sure why it isn't finding a similar doc (that is in my couchdb  
> > and should also be in my ES instance).
> > 
> > Will dig further and see if I can figure this out.
> > 
> > -warner
> > 
> > On Mon, Jun 11, 2012 at 3:40 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com)  
> > wrote:
> > 
> > > Uh, yeah I do have a doc with that in the title :P.
> > > 
> > > Oh, and if I do something like this:  
> > > curl -XGET 'localhost:9200/syncrswim/\_search' -d '{"query" :  
> > > {"match\_all" : {}}}'
> > > 
> > > I do get the docs back:
> 
> {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0}
> 
> > > ...
> > > 
> > > And i do see the doc I'm trying to get back in that result set.
> > > 
> > > but if I try and do a search on /Event/\_search I get 0 back. Confused.
> > > 
> > > And If I try moving it up a level to:  
> > > curl -XGET '[http://localhost:9200/syncrswim/\_search?q=title:teach](http://localhost:9200/syncrswim/_search?q=title:teach)'{"took":189,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> 
> > > I get 0 back again.
> > > 
> > > -warner
> > > 
> > > On Mon, Jun 11, 2012 at 3:38 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> > > 
> > > > Silly question, but does your index have a document with teach in the  
> > > > title? 🙂 You did not provide an example of a document. Since your  
> > > > index is small, you can simply search for all documents:
> > > > 
> > > > curl -XGET '  
> > > > [http://localhost:9200/syncrswim/Event/\_search?q=\*:\*&size=25](http://localhost:9200/syncrswim/Event/_search?q=*:*&size=25)
> > > > 
> > > > Perhaps you simply do not have such a document.
> > > > 
> > > > --  
> > > > Ivan
> > > > 
> > > > On Mon, Jun 11, 2012 at 3:22 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com)  
> > > > wrote:
> > > > 
> > > > > Confused as to why a very simple query isn't working. I think I have  
> > > > > everything setup correctly, but have been having difficulty trying to  
> > > > > figure out if it's functioning the way it should.
> > > > > 
> > > > > Here's my setup:
> > > > > 
> > > > > - Couchdb
> > > > > - Couchdb river and index setup
> > > > > - Mappings for my objects
> > > > > 
> > > > > When I run my query (which should at least return one result) I get  
> > > > > this:  
> > > > > curl -XGET '  
> > > > > [http://localhost:9200/syncrswim/Event/\_search?q=title:teach](http://localhost:9200/syncrswim/Event/_search?q=title:teach)'
> 
> {"took":1,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> 
> > > > > Here's my mapping for said object:  
> > > > > curl -XGET '[http://localhost:9200/syncrswim/Event/\_mapping](http://localhost:9200/syncrswim/Event/_mapping)'
> 
> {"Event":{"properties":{"description":{"type":"string","store":"yes"},"title":{"type":"string","store":"yes"}}}}
> 
> > > > > and here's my river:  
> > > > > curl -XGET '[http://localhost:9200/\_river/syncrswim/\_meta](http://localhost:9200/_river/syncrswim/_meta)'  
> > > > > {"\_index":"\_river","\_type":"syncrswim","\_id":"\_meta","exists":false}
> > > > > 
> > > > > And my index  
> > > > > curl -XGET '[http://localhost:9200/syncrswim/\_status](http://localhost:9200/syncrswim/_status)'
> 
> {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97},"shards":{"0":[{"routing":{"state":"STARTED","primary":true,"node":"YYRIHgGwTIS\_SBvoA4u\_SQ","relocating\_node":null,"shard":0,"index":"syncrswim"},"state":"STARTED","index":{"size":"98.9kb","size\_in\_bytes":101373},"translog":{"id":1339435624749,"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97}}]}}}}
> 
> > > > > Looking at this section:  
> > > > > {"num\_docs":24,"max\_doc":24,"deleted\_docs":0}
> > > > > 
> > > > > Which is the correct number of docs.
> > > > > 
> > > > > Any ideas on why my query isn't returning anything? Thank you :-).
> > > > > 
> > > > > -warner

---

<div class="post-metadata">

**Author:** ![Warner\_Onstine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warner_onstine/32/1086_2.png) [@Warner\_Onstine](https://discuss.elastic.co/u/Warner_Onstine)\
**Post date:** [June 12, 2012, 1:46pm UTC](https://discuss.elastic.co/t/query-not-working/8047/7 "2012-06-12T13:46:53Z")

</div>

When you say I should "adapt" the mapping you don't really say why or  
to what. I've read through the links you sent and I'm not sure what  
exactly I should be adapting so that I can do a search like  
"understand" and have the word "Understanding" match.

I guess I'll dig further in the docs, but I thought that stemming was  
on bey default.

-warner

On Tue, Jun 12, 2012 at 12:35 AM, Tanguy [tlrx.dev@gmail.com](mailto:tlrx.dev@gmail.com) wrote:

> You should adapt the mapping of the document type "Event"
> 
> The following pages may help you:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/)  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/analyzer-field.html)  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/ngram-tokenizer.html)
> 
> -- Tanguy
> 
> Le mardi 12 juin 2012 00:46:22 UTC+2, warnero a écrit :
> 
> > Oh, I know what it is now. The title was:  
> > Teacher Training Program: Level 2 – Understanding Your World
> > 
> > It finds teacher and understanding, but it won't find "understand".
> > 
> > Config issue of some type?
> > 
> > -warner
> > 
> > On Mon, Jun 11, 2012 at 3:43 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com) wrote:
> > 
> > > Ok, weird. I just tried a different title that I could for sure see in  
> > > the output above and I get it back. Hmm
> > > 
> > > curl -XGET '[http://localhost:9200/syncrswim/\_search?q=title:Course](http://localhost:9200/syncrswim/_search?q=title:Course)'
> > > 
> > > {"took":41,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":2,"max\_score":1.3472557,  
> > > ...
> > > 
> > > So, not sure why it isn't finding a similar doc (that is in my couchdb  
> > > and should also be in my ES instance).
> > > 
> > > Will dig further and see if I can figure this out.
> > > 
> > > -warner
> > > 
> > > On Mon, Jun 11, 2012 at 3:40 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com)  
> > > wrote:
> > > 
> > > > Uh, yeah I do have a doc with that in the title :P.
> > > > 
> > > > Oh, and if I do something like this:  
> > > > curl -XGET 'localhost:9200/syncrswim/\_search' -d '{"query" :  
> > > > {"match\_all" : {}}}'
> > > > 
> > > > I do get the docs back:
> > > > 
> > > > {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0}  
> > > > ...
> > > > 
> > > > And i do see the doc I'm trying to get back in that result set.
> > > > 
> > > > but if I try and do a search on /Event/\_search I get 0 back. Confused.
> > > > 
> > > > And If I try moving it up a level to:  
> > > > curl -XGET  
> > > > '[http://localhost:9200/syncrswim/\_search?q=title:teach](http://localhost:9200/syncrswim/_search?q=title:teach)'{"took":189,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> > > > 
> > > > I get 0 back again.
> > > > 
> > > > -warner
> > > > 
> > > > On Mon, Jun 11, 2012 at 3:38 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> > > > 
> > > > > Silly question, but does your index have a document with teach in the  
> > > > > title? 🙂 You did not provide an example of a document. Since your  
> > > > > index is small, you can simply search for all documents:
> > > > > 
> > > > > curl -XGET  
> > > > > '[http://localhost:9200/syncrswim/Event/\_search?q=\*:\*&size=25](http://localhost:9200/syncrswim/Event/_search?q=*:*&size=25)
> > > > > 
> > > > > Perhaps you simply do not have such a document.
> > > > > 
> > > > > --  
> > > > > Ivan
> > > > > 
> > > > > On Mon, Jun 11, 2012 at 3:22 PM, Warner Onstine [warnero@gmail.com](mailto:warnero@gmail.com)  
> > > > > wrote:
> > > > > 
> > > > > > Confused as to why a very simple query isn't working. I think I have  
> > > > > > everything setup correctly, but have been having difficulty trying to  
> > > > > > figure out if it's functioning the way it should.
> > > > > > 
> > > > > > Here's my setup:
> > > > > > 
> > > > > > - Couchdb
> > > > > > - Couchdb river and index setup
> > > > > > - Mappings for my objects
> > > > > > 
> > > > > > When I run my query (which should at least return one result) I get  
> > > > > > this:  
> > > > > > curl -XGET  
> > > > > > '[http://localhost:9200/syncrswim/Event/\_search?q=title:teach](http://localhost:9200/syncrswim/Event/_search?q=title:teach)'
> > > > > > 
> > > > > > {"took":1,"timed\_out":false,"\_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}
> > > > > > 
> > > > > > Here's my mapping for said object:  
> > > > > > curl -XGET '[http://localhost:9200/syncrswim/Event/\_mapping](http://localhost:9200/syncrswim/Event/_mapping)'
> > > > > > 
> > > > > > {"Event":{"properties":{"description":{"type":"string","store":"yes"},"title":{"type":"string","store":"yes"}}}}
> > > > > > 
> > > > > > and here's my river:  
> > > > > > curl -XGET '[http://localhost:9200/\_river/syncrswim/\_meta](http://localhost:9200/_river/syncrswim/_meta)'  
> > > > > > {"\_index":"\_river","\_type":"syncrswim","\_id":"\_meta","exists":false}
> > > > > > 
> > > > > > And my index  
> > > > > > curl -XGET '[http://localhost:9200/syncrswim/\_status](http://localhost:9200/syncrswim/_status)'
> > > > > > 
> > > > > > {"ok":true,"\_shards":{"total":2,"successful":1,"failed":0},"indices":{"syncrswim":{"index":{"primary\_size":"98.9kb","primary\_size\_in\_bytes":101373,"size":"98.9kb","size\_in\_bytes":101373},"translog":{"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97},"shards":{"0":[{"routing":{"state":"STARTED","primary":true,"node":"YYRIHgGwTIS\_SBvoA4u\_SQ","relocating\_node":null,"shard":0,"index":"syncrswim"},"state":"STARTED","index":{"size":"98.9kb","size\_in\_bytes":101373},"translog":{"id":1339435624749,"operations":0},"docs":{"num\_docs":24,"max\_doc":24,"deleted\_docs":0},"merges":{"current":0,"current\_docs":0,"current\_size":"0b","current\_size\_in\_bytes":0,"total":0,"total\_time":"0s","total\_time\_in\_millis":0,"total\_docs":0,"total\_size":"0b","total\_size\_in\_bytes":0},"refresh":{"total":2,"total\_time":"207ms","total\_time\_in\_millis":207},"flush":{"total":2,"total\_time":"97ms","total\_time\_in\_millis":97}}]}}}}
> > > > > > 
> > > > > > Looking at this section:  
> > > > > > {"num\_docs":24,"max\_doc":24,"deleted\_docs":0}
> > > > > > 
> > > > > > Which is the correct number of docs.
> > > > > > 
> > > > > > Any ideas on why my query isn't returning anything? Thank you :-).
> > > > > > 
> > > > > > -warner

---

<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:** [June 13, 2012, 10:36am UTC](https://discuss.elastic.co/t/query-not-working/8047/8 "2012-06-13T10:36:51Z")

</div>

> I guess I'll dig further in the docs, but I thought that stemming was  
> on bey default.

No, stemming isn't on by default. Which language would we stem for?  
Different languages can have very different structures.

There are many languages supported:

> **[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.

clint

---

<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:24am UTC](https://discuss.elastic.co/t/query-not-working/8047/9 "2017-07-06T03:24:37Z")

</div>


