Shay,
Thanks for the tip on the type._id! I thought in the docs that it stated
that there would be a performance hit to manually calling refresh,
especially under large write volumes. I'm concerned with an indexing
performance hit since I'm planning on having very high write load to ES.
Since I have the document in hand already (so to speak), is there any type
of Java api that I could use to see if it would be a hit after it was
indexed? If that is not an option, I thought of potentially creating new
indicies that are short lived (say 5min), and insert the incoming documents
into that index, refresh, and then search it. My reasoning was that this
temporary index would have a much smaller volume of documents, and could
therefore be much easier to refresh. Is that reasoning sound? I would love
to hear any ideas you have on how to solve this challenge in ES.
Regards,
Rich
On Sat, Dec 4, 2010 at 3:16 PM, Shay Banon shay.banon@elasticsearch.comwrote:
Yes, the indexed doc will not be visible for search until the a schedule
refresh kicks in, or you call the refresh API. Regarding the filtered query,
thats the way to go, with one enhancement: use "my_type._id" for the field
name, and not just _id.
-shay.banon
On Saturday, December 4, 2010 at 9:53 PM, Rich Kroll wrote:
Lukas,
Thanks for taking the time to respond. I have not been using the index API
to specify IDs as I do not want to create an id generation algo when the IDs
provided by ES work perfectly for me already.
I believe I have found a way to get what I need with the following:
curl -XGET 'http://localhost:9200/my_index/my_type/_search?pretty=true' -d
'
{
"query" : {
"filtered" : {
"query" : {
"query_string" : {
"query" : "my search query"
}
},
"filter" : {
"term" : { "_id" : "Yg3FWjfHRm62uLdqkl832g" }
}
}
}
}'
The question I have now is - will I run into any problems with visibility
of the document in the index using this strategy? I am hoping that since I
was returned an ID of the indexed document that I can then immediately
perform a search for it.
Regards,
Rich
--
“We can't solve problems by using the same kind of thinking we used when we
created them.” ~ Albert Einstein