-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kibana 4.3.1/4.3.3 discovery across multiple monthly indices - sets size=0 / search_type=‘count’ #6697
Comments
Is it possible to share your actual data? If so a snapshot created using the snapshot API would be greatly appreciated. |
PS: if you can share privately but not publicly you can send me a link via IRC. I'm spalger on freenode |
Hi Spencer, I will see what I can do. |
ahh, after some debugging I see the problem. The cluster was es 1.7.1 until sometime in February. The following is the response to the initial _field_stats request, notice the change in the formatting of the min_value and max_value from a date string to the epoc.
What is happening is then in the queue we are placing min and max values that are NaN this results in the function SegmentedReq.prototype._pickSizeForIndices to return 0, which results in the search request saying "count" and size:0 I will now focus on what the difference was with the indices between es 1.7.1 and 2.1.1, but @spalger do you know off the top of your head if the date time format changed. |
In elasticsearch 2+ the min and max values for dates now come back as milliseconds from epoch, so that we don't have to worry about formatting. |
Thanks Spenser, so are you saying that existing clusters that update are S.O.L. when it comes to some of the discovery capabilities? Should I look up at the cluster side to see if I can do something to get the old indices to return milliseconds from epoch? |
@scaph01 Can you check your mapping? Are you sure things are getting indexed correctly? Make sure you're not accidentally indexing as a number into some indices? |
@rashidkpc - thanks - I checked production Kibana is not showing any mapping conflicts, the testbed is however showing this (for a non-time related field). I am seeing the issue on both production and the testbed...but for my sanity I will find the index that has a type mismatch. While I hunt do you mind explaining the rationale around checking the mapping? I guess I would like to understand where the index time range is calculated and how the mapping could influence that. |
@rashidkpc - so I cleaned up the index that was causing some field mapping issues. However I will note that I am still seeing the client sending a "size:0" request. I then started to look at the field_stats response, and then I started to see where you were going, did the mapping for out field with the event time change? looking at the recent indices for the month there is a change:
We upgraded from ES 1.7.1 to 2.1.1 in Feb 2016, with the March index being the first created under es 2.1.1. The type was always known as date. the format did change though. I checked our mapping and it was always: now that we are in April, seems that the new indices are returning date string formatted ranges:
I am thinking that we will have to be specific in the mapping to make sure the format is epoch millis and re-index the March and April data |
FYI: using the mapping: does seem to force the returned field_stats for the date time field to be in epoch_millis. I think I can work around this with a mapping update and re-index of old data |
So, looking deeper some more, what I am seeing is that even with
I am seeing the map function in is assuming that when the min_value is a string that its a date string format value. I suspect, the call to moment(VALUE) should be checking if the value is numeric and casting over to an int for instance something like this "works" moment(parseInt(field.max_value)). So I am thinking that this is a bug in Kibana 4.x in its handling of this response information about the index. If I want to work around this, I think I really want to force my indices to use the ISO 8601 format (and not millis since epoch). I would only want to take action after some feedback, because if you deem the epoch the "better" format to receive then I will not need to reindex all data (just my most recent indices) There is a comment in the code that references: which is partially to blame here as well, where the assumption was the "String" was the ISO format. So to recap: mapping in place For our EventTime: Kibana is passing the field stats to moment() and that is returning NaN when the value is the millis since epoch. If that value was cast to a numeric type then it works. |
hey guys - any thoughts on my comments above, this has been lingering for a while. |
@scaph01 sorry this is been sitting so long, Rashid's out on vacation and Spencer is pretty busy with other projects. I just read through all the details and I agree with your assessment. Switching all your mappings to |
Thanks for the feedback @Bargs . I will get back into this and see about moving to es 2.3 (there are some features we can make use of) |
I'll be closing this since this seems very old and I can't see any immediate bug report or feature request in it. Please feel free to leave a comment in case this issue is still relevant. |
Environment:
ES 2.1.1
Kibana 4.3.1 and Kibana 4.3.3
I have a set of monthly going back a couple of years. When using Kibana in discovery, searching back a few months, I am seeing the histogram is showing the proper hits, but in the table below, the data for some of the indices is missing. What I am, for instance, if I am searching for data from Jan 3 2016 until March 15 2016, I am seeing from my browser an _msearch request, for each month (Jan, Feb and March), which is perfect.
However the request for Feb is always leaving with a search_style="count" and size set to zero, like this:
compared to Jan and March:
The search result size in total is 240 documents and I have set the discover:sampleSize to it's max of 9,999 with no change in behavior.
Additional details
-- my Jan index has 690K documents (my filter will match ony 120 documents from this index)
-- Feb has 245K documents (my filter will match only 27 documents)
-- March as 505K (my filter will match only about 100 documents)
The text was updated successfully, but these errors were encountered: