Currently, if an item has two labels—one in the mul language (which acts as the default for all languages) and another in Spanish (or any other specific language)—searching for the mul label using any language except Spanish will return an empty result, even though the item exists and has a label in mul.
Example Item
- Item: Q777 on Beta Wikidata
- Labels:
- mul: mul-label
- es: multietiqueta
Example querying using simple search endpoint:
Search query:
https://wikidata.beta.wmflabs.org/w/rest.php/wikibase/v0/search/items?language=en&q=mul-label
Search parameters:
- Query: mul-label
- Language: en
Result:
{
"results": []
}Same example with using wbsearchentities:
Search query:
https://wikidata.beta.wmflabs.org/w/api.php?action=wbsearchentities&format=json&search=mul-label&language=en&formatversion=2
Search parameters:
- search: mul-label
- Language: en
Result:
{
"searchinfo": {
"search": "mul-label"
},
"search": [],
"success": 1
}Example Querying the Spanish label with using simple search endpoint:
Search query:
https://wikidata.beta.wmflabs.org/w/rest.php/wikibase/v0/search/items?language=en&q=multietiqueta
Search parameters:
- Query: multietiqueta
- Language: en
Result:
{
{
"results": [
{
"id": "Q777",
"display-label": {
"language": "mul",
"value": "mul-label"
},
"description": {
"language": "en",
"value": "XZwcurkjRsNhaBuFuwka"
},
"match": {
"type": "label",
"language": "es",
"text": "multietiqueta"
}
}
]
}
}Summary
- Labels in the mul language are not directly searchable using either the REST simple search endpoints or the wbsearchentities.
- However, a mul label can appear as the display label in the search results if the item is matched via another language label (e.g. es), and mul is selected as the best match for display (due to fallback rules).
Expected behavior: Labels in mul should be searchable regardless of the language.
A similar wbsearchentities request does find items by their mul labels on wikidata.org (production). The search index there contains mul: https://www.wikidata.org/w/api.php?action=cirrus-mapping-dump&format=json&formatversion=2
whereas the one for beta wikidata doesn't: https://wikidata.beta.wmflabs.org/w/api.php?action=cirrus-mapping-dump&format=json&formatversion=2