You still have a deletion, so it appears you are indexing a document with
the same id twice. When you reindex a document, Lucene will behind the
scene delete the original document and index the new one. Can you double
check your indexing code to see if you id generation is valid?
--
Ivan
On Mon, Jun 24, 2013 at 5:03 PM, Edward Sargisson esarge@pobox.com wrote:
Hi all,
Why would we be able to find a document by its ID but not see it if we use
a q=: search? Or a search with no criteria.This must be a newbie question because we must be missing something but at
the moment we don't know what to look at.The index contains 99 events with ids like Id0, Id1, etc. The event we're
looking for as an id of 56505330-8b6c-11e2-894d-24be05270b5c.We can put a document in the index and retrieve it directly. Here's the
retrival:
curl
localhost:9200/audit-events-sal_ci-2013-03-14/log/56505330-8b6c-11e2-894d-24be05270b5c{"_index":"audit-events-sal_ci-2013-03-14","_type":"log","_id":"56505330-8b6c-11e2-894d-24be05270b5c","_version":1,"exists":true,
"_source" :
{"eventType":"ADD_USER","eventTime":"1363219822000","_id":"56505330-8b6c-11e2-894d-24be05270b5c"}}However, if we look for it using q=: we can't find it.
curl
'localhost:9200/audit-events-sal_ci-2013-03-14/_search?pretty=true&q=:&size=200'{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 99,
"max_score" : 1.0,
"hits" : [ {
"_index" : "audit-events-sal_ci-2013-03-14",
"_type" : "log",
"_id" : "Id3",
"_score" : 1.0, "_source" :
{"eventType":"ADD_USER","eventTime":"1363262403000","_id":"Id3"}
}, ...If we search for stats we see the following - we should 100 events:
curl 'localhost:9200/audit-events-sal_ci-2013-03-14/_stats?pretty=true'{
"ok" : true,
"_shards" : {
"total" : 10,
"successful" : 5,
"failed" : 0
},
"_all" : {
"primaries" : {
"docs" : {
"count" : 99,
"deleted" : 1
}, ...If it's relevant to this problem, previous versions of this problem
involved deleting and re-adding a document with the same ID. We've now
removed that part of the test and are using a completely new ID in order to
exclude that.We have Java code that does the following:
final SearchResponse response =
client.prepareSearch(indexNames.toArray(new String {})).setTypes("log")
.setIgnoreIndices(IgnoreIndices.MISSING).execute().actionGet();It too only returns 99 records - and not the one we're looking for.
So, please put us out of our dire misery and tell us what nugget of
knowledge we have overlooked in our search for enlightenment.Many thanks,
Edward--
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.
For more options, visit https://groups.google.com/groups/opt_out.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.