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

[Bug] Unexpected sorting results #1045

Open
plokhotnyuk opened this issue Jul 13, 2022 · 4 comments
Open

[Bug] Unexpected sorting results #1045

plokhotnyuk opened this issue Jul 13, 2022 · 4 comments
Labels

Comments

@plokhotnyuk
Copy link

Current behavior

image

Expected Behavior

Projects with greater sorted value (stars/forks/contributors) should be higher

Extra comments

No response

Search terms

No response

@Santhoshmani1
Copy link

  • The results are sorted based on the logarithm of the product of results & Scala percentage in the projects. This leads to unexpected sorting results instead of decreasing order.

Screenshot 2024-03-05 181919

Search request of filters in ElasticsearchEngine.scala

  • Currently, the filters of stars, forks and contributors use the same approach.
    The searchRequest function in the ElasticsearchEngine scala uses the mentined logarithm approach to sort the results.

Screenshot 2024-03-05 181935

Filter function using logarithm

Approach

We can modify the combinedwithpercentage function to sort the results to follow the decreasing order in order to filter out the results correctly, instead of considering the scalaPercentage value used in the project.
I would like to contribute to solve this issue.

cc @adpi2

@adpi2
Copy link
Member

adpi2 commented Mar 5, 2024

We can modify the combinedwithpercentage function to sort the results to follow the decreasing order in order to filter out the results correctly, instead of considering the scalaPercentage value used in the project.
I would like to contribute to solve this issue.

Thanks @Santhoshmani1 for the detailed investigation of this issue. We designed the combinedWithPercentage function to solve one issue that we had before: the first result page was full of Java projects (they tend to have more stars). Those Java projects are indexed by Scaladex because they also publish at least one Scala artifact, or they did in the past.

Using the scalaPercentage we managed to mitigate this issue, and the result looks much more relevant: the first result page contains the most popular Scala projects and very few Java projects.

So when we say that we sort by number of Stars it is not really correct and I understand it can be perceived as a bug. But strictly sorting by Stars would not be really relevant. My suggestion would be to use a different word for the sorting criteria: Popularity instead of Stars. WDYT?

@Santhoshmani1
Copy link

Santhoshmani1 commented Mar 5, 2024

Thanks for the clarification adpi2.

We can create a new function to sort the results of total contributors & commit activity to sort in descending order.

The change of stars field to popularity also makes more sense.

@adpi2
Copy link
Member

adpi2 commented Mar 5, 2024

We can create a new function to sort the results of total contributors & commit activity which are sorted in descending order.

The issue is the same for commit activity and contributors: we don't want to have the first page full of Java projects. So should we rename those too? I am not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants