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

[Potential Feature] Extending Arches search results sort order component for additional and custom sorts #11780

Open
SDScandrettKint opened this issue Feb 10, 2025 · 2 comments
Assignees
Labels
Audience: Developer The audience for the issue is a software developer Audience: End User The audience for the issue is an end user of the instance

Comments

@SDScandrettKint
Copy link
Member

SDScandrettKint commented Feb 10, 2025

Original user story/request: "We would like to be able to search for our results in a specific order of resource models, for example show all Monuments first, then Activities, then Sources etc."

Intially, we began looking at modifying the SortResults component to implement our own elasticsearch DSL query, replacing the default. This worked fine, but of course was quite invasive to core Arches. When trying to make it an improvement/expansion to the core feature, we used the config field to provide information to the component, but even this seemed to be too narrow or specific of an improvement and opened up a few other questions.

Thinking how this could benefit all users of Arches, we think it could be a very nice feature if the SortResults component could be extended to support custom queries, while not impacting the current sorting of the display name within Arches.

At the moment, the sort order of search results is a bit all or nothing, with no option to move between different sort options in the UI, other than ascending and descending on the Primary Descriptor. One idea could be to introduce a new 'sort by' drop down in the UI with some common options e.g. 'Name' (the current default), maybe a 'Date created' (although this opens another can of worms as edit/creation dates aren't in the ES resources index at present), maybe move unsorted in here as well etc., with the config being used to add any additional custom options (e.g. 'Graph - custom order'). This new custom order would then appear as a dropdown option. Asc and desc could also be a separate dropdown, flexible to only show if the selection isn't unsorted.

To put the ideas in lists...

Requirements:

  • Expand the Sort component to allow users to provide custom queries, most likely in the form of ES DSL - originally we thought as a config option, but it's possible this feature could follow the same process as creating and registering a custom ES index?
  • Retain the original display name sort order - ascending and descending, so anyone who does not wish to use this feature is not impacted.
  • Allow multiple custom orders to be added and used.

Desirables:

  • Create a new dropdown for the different types of sort ("Sort Type") - Primary Descriptor/Name is the only one at present - this would leave us with two dropdowns for sort - "Sort Type" and "Sort by".
    • It would also make sense to move the option "unsorted" as one of the types, as it wouldn't make sense to be included in ascending / descending.
    • The ascending/descending dropdown could appear if a sort that isn't unsorted is selected?
  • An option to set a default sort - whether this is a global setting e.g. in the component config, or per user?

Needs further discussion/approval:

  • Add some more default sorts to core Arches. Primary Descriptor/Name is the only one at present, but we could add options for creation or edit dates.
@chiatt chiatt added this to pipeline Feb 10, 2025
@SDScandrettKint SDScandrettKint self-assigned this Feb 10, 2025
@SDScandrettKint SDScandrettKint added Audience: End User The audience for the issue is an end user of the instance Audience: Developer The audience for the issue is a software developer labels Feb 10, 2025
@SDScandrettKint
Copy link
Member Author

A video showing an early potential mockup. Ignore the CSS/order of dropdowns, but it demonstrates a custom order.

Sorting.demo.mp4

@whatisgalen
Copy link
Member

This is a great issue! A few thoughts:

  • I wholeheartedly second the idea that tile create and update datetimes should live in the ES index. As it stands, you can add this yourself thanks to some index injection work done by @bferguso.
  • Additionally, you can actually create your own "search-view" from scratch to more directly incorporate sorting if only modifying the "SortFilter" doesn't suffice. Feel free to slack me and I can show you more of what I mean.
  • Lastly, I can imagine a multi-select2 widget for sorting where you pick from a variety of things and then click that thing to toggle asc/desc (like how you can invert a term filter by clicking the "+" to make it a "-")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Audience: Developer The audience for the issue is a software developer Audience: End User The audience for the issue is an end user of the instance
Projects
Status: No status
Development

No branches or pull requests

3 participants