Skip to content
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

Converted hard-coded search results sort option "by relevance" to configuration individual. #431

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

litvinovg
Copy link
Contributor

@litvinovg litvinovg commented Dec 14, 2023

Related VIVO PR

What does this pull request do?

Converted hard-coded search results sort option "by relevance" to configuration individual.
Without that there is no way to change order of sort options on search results page.
Apply first sort option if no query text was provided and no sort option was explicitly set.

Interested parties

@VIVO-project/vivo-committers

@litvinovg litvinovg requested a review from chenejac December 14, 2023 09:13
@litvinovg litvinovg force-pushed the fix_sort_by_relevance branch from ac80a0b to a9c4cd8 Compare December 14, 2023 09:56
@litvinovg litvinovg marked this pull request as draft December 14, 2023 10:04
@litvinovg litvinovg force-pushed the fix_sort_by_relevance branch from a9c4cd8 to e392833 Compare December 14, 2023 10:53
…dual

Apply first sort option none was specificly defined and if query text wasn't provided, which means that only facets were used
@litvinovg litvinovg force-pushed the fix_sort_by_relevance branch from e392833 to 0c69553 Compare December 14, 2023 11:31
@litvinovg litvinovg marked this pull request as ready for review December 14, 2023 11:32
Copy link
Contributor

@chenejac chenejac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@litvinovg thanks for this. Couple of comments:

  • when I am entering search page (from the home page, type some text and hit the button Search), the list of results is shown, it is ordered by relevance, but in the dropdown list it is "Sort by" (not "Sort by Relevance")
  • should we make labels for other languages ? Meaning to create search_individuals_vitro.n3 and vitro_extended_search.ttl for other languages (with google translations for the beginning)
  • also, we need a strategy when new set labels are grouped in a new file (vitro_extended_search.ttl), and when it is just added in vitro_UiLabel.ttl

@litvinovg
Copy link
Contributor Author

@litvinovg thanks for this. Couple of comments:

* when I am entering search page (from the home page, type some text and hit the button Search), the list of results is shown, it is ordered by relevance, but in the dropdown list it is "Sort by" (not "Sort by Relevance")

Yes. "Sort by" is a label for the field, not a selected value. Sorting option that was used doesn't present as chosen in the list of sorting options. Until sorting option explicitly selected sorting type is decided by contents of search query: if any text provided, then sort by relevance; if no text was provided, then search by first sort option defined by the used. If sort option wasn't set explicitly it is not saved for the user to avoid situation when at first user selected some filters, got results sorted by first defined sorting option and sorting option is saved and then added some text. In that case sorting option saved on previous step would prevent user from getting results based on scores calculated from text query.

* should we make labels for other languages ? Meaning to create search_individuals_vitro.n3 and vitro_extended_search.ttl for other languages (with google translations for the beginning)

Yes.

@litvinovg
Copy link
Contributor Author

@chenejac Added translations for different languages. We need reviews from native speakers.

litvinovg and others added 2 commits January 11, 2024 11:15
Co-authored-by: Benjamin Kampe <benjamin@fehrmanns.net>
Copy link
Contributor

@chenejac chenejac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@litvinovg I will post one comment in the VIVO PR linked with this PR. This looks ok to me.

@chenejac chenejac requested review from milospp and removed request for ivanmrsulja January 16, 2024 12:21
@litvinovg
Copy link
Contributor Author

I tested sorting after the discussion at the meeting. It seems to be working.

@chenejac chenejac merged commit 7abd6cd into vivo-project:main Feb 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants