I am new to ElasticSearch. I tried the sample BulkRequestBuilder code to
populate the index, but when i am retrieving the index by a query it gives
0 hits.
i am using the following code for indexing. Please help
Are you using the default mapping? Your are using a TermQuery, which
should be used only on non-analyzed fields. That said, the term
"kimchy" should be the same, analyzed or not. Is indexName = to
"twitter"? Any errors in bulkResponse? Check
bulkResponse.items().length and bulkResponse.hasFailures().
Yes, the mapping is default and the indexName is "twitter". bulkResponse
does not have any failures. Is there any way to check whether the documents
are added in the index?
On Tue, Jun 12, 2012 at 10:33 PM, Ivan Brusic ivan@brusic.com wrote:
Are you using the default mapping? Your are using a TermQuery, which
should be used only on non-analyzed fields. That said, the term
"kimchy" should be the same, analyzed or not. Is indexName = to
"twitter"? Any errors in bulkResponse? Check
bulkResponse.items().length and bulkResponse.hasFailures().
After a bit of researching i got a small app that tells number of document
in the ES index. I ran that application, and figured out that the documents
are not getting added to the index. The search code looks fine to me. Any
idea why the documents are not getting added using bulkRequestBuilder?
Yes, the mapping is default and the indexName is "twitter". bulkResponse
does not have any failures. Is there any way to check whether the documents
are added in the index?
On Tue, Jun 12, 2012 at 10:33 PM, Ivan Brusic ivan@brusic.com wrote:
Are you using the default mapping? Your are using a TermQuery, which
should be used only on non-analyzed fields. That said, the term
"kimchy" should be the same, analyzed or not. Is indexName = to
"twitter"? Any errors in bulkResponse? Check
bulkResponse.items().length and bulkResponse.hasFailures().
I got the answer. I was doing the search wrong, I gave the type as "tweet"
but while searching i was only giving fieldName as "user" , however it
should have been "tweet.user" . Its giving 2 hits now. Thanks for the reply
anyways.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.