The search you're performing should be equivalent to:
select count(*) from resources where title like 'buddha';
If you want '%buddha%' you would use a wildcard search with 'buddha'
(it's not ideal to use wildcards as prefixes though - there are ways to
optimize for that).
Also, the type of analyzer you are using is important. I believe by default
ES will use the standard analyzer which lowercases everything, which is
probably what you want. If however you set a different analyzer it's
possible that a search for 'buddha' does not find 'Buddha'.
I've found Elasticsearch Head to be a big help it doing quick queries and
looking at the documents in the index (Luke is good too, but I only pull
that out when things get dirty).
http://mobz.github.com/elasticsearch-head/
Hope that helps,
Anil
On Thursday, December 6, 2012 4:13:36 PM UTC-8, hassan wrote:
I just started experimenting with ES and I have the following issue:
From a MySQL DB table, I created an index of records using the
Ruby Tire gem.
The index (checked with curl and ruby console) shows the same
count of indexed items as there are DB rows. Good so far.
When I do a simple single-word query (with Ruby or curl) e.g.
'{ "query" : { "term" : { "title" : "buddha" }}}'
I get fewer hits compared to
select count(*) from resources where title like '%buddha%';
The latter returns 423; ES returns 293.
What would account for this? All suggestions appreciated 
There are no errors being reported to stdout (running with -f flag)
BTW. Platform: Mac OS 10.7.5, ES 0.19.12.
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com<javascript:>
Hassan Schroeder | about.me
twitter: @hassan
--