Allow SearchService#search_state to be mutated#3841
Conversation
This allows us to adjust the search_state and run a query again, without having to reinitialize the object. This can be used in a report where you may want to iterate through a bunch of pages of results to construct a CSV.
|
I find mutating |
|
@jcoyne Can you speak to the use case motivating wanting to do this? Like is a user asking for something and this makes that feature easier? |
|
@tpendragon I was thinking of paging through a result set to write a report. So, initialize the SearchService once, then call search_results, update the page in the search_state, then call search_results again, repeat until done. In the existing code, I have to have a different SearchService instance for each page of results. |
@cbeer yes, I think that approach would work just as well. |
|
Do we need a new test ensuring as supported tested API? I approved anyway, up to you. |
This allows us to adjust the search_state and run a query again, without having to reinitialize the object.
This can be used in a report where you may want to iterate through a bunch of pages of results to construct a CSV.