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

Added Project Page Sorting #552

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Rajgupta36
Copy link
Collaborator

@Rajgupta36 Rajgupta36 commented Jan 19, 2025

Resolves #73

Task Progress

  • Added replicas into indexes
  • Added custom ranking to the indexes
  • Created sortBy component (reusable in future)
  • Customize api and searchPageLayout components
  • Writing test cases

Media

sortby.mp4

Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

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

Haven't checked out and tested this yet locally, but from the video you posted I'm thinking it would be good to show which sorting is currently applied even when the sorting dropdown is collapsed.
What do you think?

@Rajgupta36
Copy link
Collaborator Author

Rajgupta36 commented Jan 20, 2025

Haven't checked out and tested this yet locally, but from the video you posted I'm thinking it would be good to show which sorting is currently applied even when the sorting dropdown is collapsed. What do you think?

Yeah, we can do that. Currently, I show a tick mark next to the sorting attribute which is applied. If I display the component value, it might increase the size too much and look weird, since each component has a different value length.

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

I also have some suggestions on how the search bar + sorting should look like. Let's deal with that later.

f"{env}_projects_forks_desc": ["desc(idx_forks_count)"],
}

client.set_settings(f"{env}_projects", {"replicas": list(replicas.keys())})
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems replicas can be created in index/projects.py

@@ -91,4 +92,26 @@ def get_queryset(self):
@staticmethod
def update_synonyms():
"""Update synonyms."""
ProjectIndex.configure_project_replicas()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be a separate flow just similar to update_synonyms.
Name it def configure_replicas

replicas = {
f"{env}_projects_name_asc": ["asc(idx_name)"],
f"{env}_projects_name_desc": ["desc(idx_name)"],
f"{env}_projects_stars_asc": ["asc(idx_stars_count)"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use full name for a new index (stars_asc -> stars_count_asc)

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

Successfully merging this pull request may close these issues.

Implement Project page sorting
3 participants