Skip to content

Conversation

@superpegaso2703
Copy link
Member

@superpegaso2703 superpegaso2703 commented Feb 12, 2026

Updated search.rst, now it includes score floating-point value in sort parameter

Preview at https://dataverse-guide--12160.org.readthedocs.build/en/12160/api/search.html

What this PR does / why we need it:
It updates search.rst in order to include score floating-point value calculated by Solr, sent with sort parameter.
Which issue(s) this PR closes:

Special notes for your reviewer:
No, just documentation being updated.
Suggestions on how to test this:

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

Additional documentation:

Updated search.rst, now it includes score floating point value in sort parameter
@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Feb 13, 2026
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Just some quick feedback.

type string Can be either "dataverse", "dataset", or "file". Multiple "type" parameters can be used to include multiple types (i.e. ``type=dataset&type=file``). If omitted, all types will be returned. For example, https://demo.dataverse.org/api/search?q=*&type=dataset
subtree string The identifier of the Dataverse collection to which the search should be narrowed. The subtree of this Dataverse collection and all its children will be searched. Multiple "subtree" parameters can be used to include multiple Dataverse collections. For example, https://demo.dataverse.org/api/search?q=data&subtree=birds&subtree=cats .
sort string The sort field. Supported values include "name", "date" and "relevance". See example under "order".
sort string The sort field. Supported values include "name", "date", and "score". Sorting by "score" orders by **Relevance** (highest to lowest) and is the default if this parameter is omitted.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sort string The sort field. Supported values include "name", "date", and "score". Sorting by "score" orders by **Relevance** (highest to lowest) and is the default if this parameter is omitted.
sort string The sort field. Supported values include "name", "date", and "score". Sorting by "score" orders by **relevance** and is the default if this parameter is omitted.

I prefer lower-case "relevance".

Also, I'm suggesting we remove "highest to lowest" because that's controlled by order.

Comment on lines 47 to 49
.. note:: **Relevance Scoring**
Every search result includes a ``score`` field (float). This value is calculated by the search engine (Solr) and represents how relevant the item is to the search query. Higher scores indicate a closer match. When ``sort`` is set to "score" (the default), results are returned in descending order of this value.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I'm not sure this note is necessary. 🤷

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

Labels

None yet

Projects

Status: Ready for Triage

Development

Successfully merging this pull request may close these issues.

Docs: Search API sort=score

2 participants