-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixing #844 - If a category has exact name entered, show it first #867
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
Codecov Report
@@ Coverage Diff @@
## master #867 +/- ##
=========================================
+ Coverage 6.91% 7.12% +0.21%
=========================================
Files 95 96 +1
Lines 5018 5038 +20
Branches 471 473 +2
=========================================
+ Hits 347 359 +12
- Misses 4644 4651 +7
- Partials 27 28 +1
Continue to review full report at Codecov.
|
|
The suggestions are organized in sections, even though the sections are not clearly visible yet (but they will be when #76 is implemented). A section is for suggestions found via GPS, a section is for suggestions from history, a section is for suggestion via Commons search, etc. So, while sorting could be used within other sections, showing the category with the exact typed name should be done within its own section, so to speak, before all other sections. |
|
@pszklarska Thanks for the PR! Admittedly it does somewhat exceed the scope of #844 - I believe that only required a regex to check for the matching string, haha. But I don't mind categories being sorted in order of similarity, personally. Could we please get a screenshot or log of the results for a particular search term? @nicolas-raoul Do you get GPS, history, etc suggestions when you type in the search filter though? AFAIK how it works currently is that there are two types of category displays. (1) When the text field is empty, it displays GPS, history, etc suggestions. (2) When the text field has input in it, it displays solely results from the string search (alongside any categories that were selected from (1)). As #844 requires a category name to be entered in the search filter, I think it should only affect (2)? |
|
When using the app, I often upload related pictures, for instance in a
fashion history museum most pictures would need to be tagged "Fashion in
Japan" and "18th century clothes" for instance.
From the second picture, these categories conveniently appear towards the
top of the suggestions. Mixing them with everything would be very
inconvenient.
Ideally each section should be sorted differently:
History: By date of last use
Location: By distance from GPS point
Search: By string distance
…On Sep 6, 2017 23:07, "Josephine Lim" ***@***.***> wrote:
@pszklarska <https://github.com/pszklarska> Thanks for the PR! Admittedly
it does somewhat exceed the scope of #844
<#844> - I
believe that only required a regex to check for the matching string, haha.
But I don't mind categories being sorted in order of similarity,
personally. Could we please get a screenshot or log of the results for a
particular search term?
@nicolas-raoul <https://github.com/nicolas-raoul> Do you get GPS,
history, etc suggestions when you type in the search filter though? AFAIK
how it works currently is that there are two types of category displays.
(1) When the text field is empty, it displays GPS, history, etc
suggestions. (2) When the text field has input in it, it displays solely
results from the string search (alongside any categories that were
*selected* from (1)). As #844
<#844> requires
a category name to be entered in the search filter, I think it should only
affect (2)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#867 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGFBmYgkIHkVPLSspj9xvHKNtt93ubBks5sfqcMgaJpZM4PNL7D>
.
|
|
I somehow did not see your second paragraph. You are totally right, please
ignore what I wrote!
…On Sep 6, 2017 23:31, "Nicolas Raoul" ***@***.***> wrote:
When using the app, I often upload related pictures, for instance in a
fashion history museum most pictures would need to be tagged "Fashion in
Japan" and "18th century clothes" for instance.
From the second picture, these categories conveniently appear towards the
top of the suggestions. Mixing them with everything would be very
inconvenient.
Ideally each section should be sorted differently:
History: By date of last use
Location: By distance from GPS point
Search: By string distance
On Sep 6, 2017 23:07, "Josephine Lim" ***@***.***> wrote:
> @pszklarska <https://github.com/pszklarska> Thanks for the PR!
> Admittedly it does somewhat exceed the scope of #844
> <#844> - I
> believe that only required a regex to check for the matching string, haha.
> But I don't mind categories being sorted in order of similarity,
> personally. Could we please get a screenshot or log of the results for a
> particular search term?
>
> @nicolas-raoul <https://github.com/nicolas-raoul> Do you get GPS,
> history, etc suggestions when you type in the search filter though? AFAIK
> how it works currently is that there are two types of category displays.
> (1) When the text field is empty, it displays GPS, history, etc
> suggestions. (2) When the text field has input in it, it displays solely
> results from the string search (alongside any categories that were
> *selected* from (1)). As #844
> <#844>
> requires a category name to be entered in the search filter, I think it
> should only affect (2)?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#867 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAGFBmYgkIHkVPLSspj9xvHKNtt93ubBks5sfqcMgaJpZM4PNL7D>
> .
>
|
|
@nicolas-raoul @misaochan thanks for the comments :) So to sum up, I'd change sorting algorithm to regex (yeah, that might be a little overkill in this situation... I was thinking about sorting because of this comment). |
|
@pszklarska I don't think there is a need to switch to a regex given that you have already done the extra work of implementing sorting. However, I haven't had time to test your PR yet, so it would help us advise you on how to proceed if you could post screenshots or logs of how the category suggestions work in your implementation. The "categorization" of results mentioned by @nicolas-raoul should not affect this fix, as they only come into play when nothing is typed in the search filter. |
nicolas-raoul
left a comment
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.
Not tested, but looks good to me for merging :-)
|
Cool, thanks! @nicolas-raoul can you merge this? |


(Partially) fixed issue #844 by:
However, because of a limited number of results from API, this fix is not 100% correct - there can be better results for user inputs that are on the next pages of this request, so this solution only improves search for what we already get from API.