-
Notifications
You must be signed in to change notification settings - Fork 5
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
Make flavorsearch limit configurable #317
Comments
@patdunlavey my only fear is that making this a "per formatter" option would mean people forgetting/overriding a few/not all and eventually getting annoyed. The controller is used by IABookreader primarily but not limited to it.
What are your thoughts @patdunlavey ? |
I was thinking about this last night. Presumably the limit value of 100 was chosen to ensure we don't overload or crash something. I'm sure that's an arbitrary number, as will be any limit number. I'm not sure I see a use case in which it makes compelling sense for one site to use a limit of 100 and another to use a limit of 500. We can argue about what the value should be: 100 seems pretty limiting to me. Is there a reason not to just make it 500, for example? But this got me to thinking about what is the actual problem here? Assuming that there must be some limit, and that some times a flavorsearch will exceed it, perhaps the question is, how do we mitigate the negative user experience that can come from hitting that limit, regardless of what the actual limit is (only being able to find half the "dogs" in that dog book, for example)? It occurs to me that one thing we can do is simply inform the user when the limit, whatever it is, has been exceeded. Any solr query produces a count of the number of items found, as well as the actual results list. The results list is constrained by the offset and limit values, but the count is not. We could put that count into the json response, and then do something in our bookreader javascript to have it flash a message, like "225 matches found, displaying the first 100" in the same way that it flashes a message for "no matches found". (I have no idea how difficult that would be!) Back to you for your thoughts @DiegoPino ! |
@patdunlavey those are good reflections. Since Solr has no "give me all" as a server, basically every query has a limit, I am willing to explore some way of showing to the user the fact there are more hits that the server established one. It does require a refactor that (as with IA Bookreader) I am always a bit scared to do. Also, there are chances that a very high limit (if very accurate when searching for dog) might simply timeout via JS (payload too large) Give me the day to explore a few options. I will come back with some examples/code ideas by 5PM. Thanks again |
Thank you! There's no rush on my end - this is a pretty low priority. |
@patdunlavey ok. The solution that is working for me now is the following
Now to actual handling/future. If a book is about Dogs, and you search Dogs... chances are what you will see is like 10000 |
Thanks for all this @DiegoPino ! I'm not sure the effort is justified, but I love tit! I don't feel I know enough to have an opinion as to which approach is better for providing an optional limit value: via a route parameter, or as a query argument. It occurs to me that an offset, page number (in the case of multiple-page search), or both would complement this, if we anticipate a need to be able to make ajax calls to load search results incrementally. The sort by relevance question is interesting. I'm not sure how intuitive it would be in a viewing context that is very much based on moving forward and backward through pages. As a user, I think I would want to be able to toggle between the two modes. Do we really want to get into that degree of complexity in the case of the IAB? In flavorsearch, I can see the sort option also being selectable in the url, and a default sort able to be configured. I'm just not sure implementing them would be warranted if IAB is the only use-case. Perhaps a better use case can be found in Mirador or other viewer? Given the time/effort that would be needed to make use of these features, does it make sense to develop them? |
The OCR Search Controller search function limits the number of results to 100 here. That can be confusing when searching in a Book with potentially hundreds of matches. For example, in this 345 page book on dogs searching on the word "dog" only yields results through page 198.
Two challenges I can think of to this request:
The text was updated successfully, but these errors were encountered: