Skip to content

Conversation

@CWDamm-Kint
Copy link
Collaborator

This is the local implementation for custom sort orders (see archesproject/arches#11780.

If the config of the Sort search component contains custom dsl, then this is used to determine how Arches sorts the data in the main search page.

@CWDamm-Kint
Copy link
Collaborator Author

The DSL for Jersey's custom sort order (exact graph order tbc) is:

{
  "dsl": {
    "type": "number",
    "script": {
      "lang": "painless",
      "params": {
        "order": [
          "243f8689-b8f6-11e6-84a5-026d961c88e6",
          "99417385-b8fa-11e6-84a5-026d961c88e6",
          "3af584c3-fd4d-11e6-9e3e-026d961c88e6",
          "24d7b54f-5464-11e9-a86b-000d3ab1e588"
        ]
      },
      "source": "List order = params.order; int index = order.indexOf(doc['graph_id'].value); return index != -1 ? index : order.size();"
    }
  },
  "field": "_script"
}

Copy link
Member

@samuelscandrett samuelscandrett left a comment

Choose a reason for hiding this comment

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

The removal of unsorted results in this bug when clearing filters:

20251104-1427-02.7843772.mp4

@samuelscandrett samuelscandrett merged commit dda717a into project/7.6.x Nov 13, 2025
5 of 6 checks passed
@samuelscandrett samuelscandrett deleted the add_custom_sort_order branch November 13, 2025 15:53
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.

3 participants