IQSS / IQSS/dataverse

Search API: facets issue on translated custom fields

Open
#8,287 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: API Feature: Search/Browse GDCC: SciencesPO Type: Suggestion User Role: API User
Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

What steps does it take to reproduce the issue?
In a TSV file I have a controlled vocabulary with the value Politics.Elections for Topic Classification Term. This value is then translated in two languages using the java properties:

  • EN: Elections
  • FR: Élections

When I query the search API with facets enabled (show_facet: true), the label for this field is taken from the english translation. I get this:

"topicClassValue_ss": {
    "friendly": "Topic Classification Term",
    "labels": [
        {"Elections": 2657}
    ]
}

This becomes an issue when I try to search Dataverse using this facet. When I search topicClassValue_ss:"Elections" I get no results because the needed value for the search is the one not translated: topicClassValue_ss:"Politics.Elections". However, there is no way to get the needed value from the API.

  • When does this issue occur?
    When querying the Search API with a translated facet where the english translation is different from the value in the TSV file.

  • Which page(s) does it occurs on?
    In the search API.

  • What happens?
    The query returns 0 elements.

  • To whom does it occur (all users, curators, superusers)?
    Tested only on public API (with no token), but it should occur for any user.

  • What did you expect to happen?
    Be able to use the translated value for facets or have the correct name intended to be used in the API as a new field.

Which version of Dataverse are you using?
5.8

Any related open or closed issues to this bug report?
#8286

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Search API request with facets enabled for the translated custom field, then inspect the facet response and the handling of translated values. The fix is complete when the API exposes the value needed for searching or makes the translated facet value searchable, with behavior covered for the English and French translations described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.