-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Return reloaded analyzers in _reload_search_ananlyzer response #43813
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
Conversation
Currently the repsonse of the "_reload_search_analyzer" endpoint contains the index names and nodeIds of indices were analyzers reloading was triggered. This change add the names of the search-time analyzers that were reloaded. Closes elastic#43804
Pinging @elastic/es-search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new functionality + tests look good to me. I had a couple comments about the format of the response.
"failed" : 0 | ||
}, | ||
"reloaded_nodes" : [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few thoughts around the structure of this response:
- I found it a little confusing that this section was named
reloaded_nodes
, since it's centered around indices instead of nodes (and we call these sectionsIndexDetails
in the Java response). Maybereloaded_indices
would make more sense, or even justindices
? - When there is one response section per index, we often return a map instead of a list, with the index name as the map key. For example, the 'get index' and 'get mapping' APIs follow this response format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the format of the response here is a bit different. The reason for this ist that although reloading is centered around indices, it needs to be executed on each node an index shard might live on (and not only once on each shard in a replica set). So this is potentially more than one node per index. While I think the list of nodeIds that were part of reloading for each index is not that important to the average user, it can provide valuable debug information e.g. for UI clients later on.
Regarding your second point: I know we use index names as keys in several places but if not necessary I consciously try to avoid it. I makes parsing of responses more difficult because the parser need to deal with an unbounded set of keys as field names. While we mange to get around it in the places you mentioned, I try to avoid it if possible in order to make the rest response easier to parse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although reloading is centered around indices, it needs to be executed on each node an index shard might live on
That makes sense to me, I was just wondering about the name of the top-level key for the section (currently reloaded_nodes
). The name seemed fitting when this section only contained node IDs, but now that it contains analyzer information as well, maybe there could be a better name? In Java this is called reloadedIndicesDetails
, so I was bit surprised to see it called reloaded_nodes
in the REST response as opposed to something like reloaded_indices
.
I know we use index names as keys in several places but if not necessary I consciously try to avoid it.
I agree it makes parsing more difficult! To me it would be best to maintain consistency across APIs (even if it makes parsing a little harder) as opposed to having a mix of styles, since this is least surprising to users. However this may be a bigger conversation, and the API is marked as experimental and can be changed, so it doesn't seem like it should prevent merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean now with the top-level key, sorry that I missed that part. Will change to something more neutral and probably also allign the java API to that new key a bit.
@jtibshirani thanks for the review, I tried answering your questions around the response format and to explain the decisions involved on my side. Let me know if you have other suggestions for changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple responses to your comments. I'll approve since the code looks good and I don't want to hold the PR up too much, but it would be great to take a look at my suggestions to see if you want to incorporate them.
"failed" : 0 | ||
}, | ||
"reloaded_nodes" : [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although reloading is centered around indices, it needs to be executed on each node an index shard might live on
That makes sense to me, I was just wondering about the name of the top-level key for the section (currently reloaded_nodes
). The name seemed fitting when this section only contained node IDs, but now that it contains analyzer information as well, maybe there could be a better name? In Java this is called reloadedIndicesDetails
, so I was bit surprised to see it called reloaded_nodes
in the REST response as opposed to something like reloaded_indices
.
I know we use index names as keys in several places but if not necessary I consciously try to avoid it.
I agree it makes parsing more difficult! To me it would be best to maintain consistency across APIs (even if it makes parsing a little harder) as opposed to having a mix of styles, since this is least surprising to users. However this may be a bigger conversation, and the API is marked as experimental and can be changed, so it doesn't seem like it should prevent merging.
@jtibshirani sorry I missread your earlier comment about the top-level response key, it probably was a bit later. I changed ""reloaded_nodes" to the more generic "reload_details" because that makes more sense now that there is more information grouped under it. I also changed the Javas API methods to something closer to the rest section ( |
@elasticmachine run elasticsearch-ci/1 |
@elasticmachine run elasticsearch-ci/1 |
@elasticmachine update branch |
@elasticmachine test this please |
Currently the repsonse of the "_reload_search_analyzer" endpoint contains the index names and nodeIds of indices were analyzers reloading was triggered. This change add the names of the search-time analyzers that were reloaded. Closes #43804
Currently the repsonse of the "_reload_search_analyzer" endpoint contains the
index names and nodeIds of indices were analyzers reloading was triggered. This
change add the names of the search-time analyzers that were reloaded.
Closes #43804