Josh Handley
11/24/2025, 2:36 PM"name": {
"primary": "Tour Eiffel",
"en_us": "Eiffel Tower",
"es_es": "Torre Eiffel",
"fr_fr": "Tour Eiffel",
"ru_ru": "Эйфелева башня",
...
}
In the schema we index all the nested name fields (name.primary, name.en_us, name.es__es...)._ Each of the nested fields has the corresponding locale set. When I query with the Russian name (Эйфелева башня) in name.* I get six results, none that match name.ru_ru even though it is an exact match for document 83300a0000000000.
% curl 'http://localhost:8108/collections/public_places/documents/search?q=%D0%AD%D0%B9%D1%84%D0%B5%D0%BB%D0%B5%D0%B2%D0%B0%20%D0%B1%D0%B0%D1%88%D0%BD%D1%8F&query_by=name.*&query_by_weights=1' -H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" | jq ".hits[].document.name.ru_ru"
null
null
null
null
null
null
If I search in just name.ru_ru without the other name fields then I get the match with document 83300a0000000000 as I would expect.
curl 'http://localhost:8108/collections/public_places/documents/search?q=%D0%AD%D0%B9%D1%84%D0%B5%D0%BB%D0%B5%D0%B2%D0%B0%20%D0%B1%D0%B0%D1%88%D0%BD%D1%8F&query_by=name.ru_ru&query_by_weights=1' -H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" | jq ".hits[].document.name.ru_ru"
"Эйфелева башня"
Trying to narrow it down, if I search with the two fields name.ru_ru and name.primary with equal weights, I get different results depending on the order. Putting ru_ru first finds the doc but putting primary first does not.
ru_ru first:
curl 'http://localhost:8108/collections/public_places/documents/search?q=%D0%AD%D0%B9%D1%84%D0%B5%D0%BB%D0%B5%D0%B2%D0%B0%20%D0%B1%D0%B0%D1%88%D0%BD%D1%8F&query_by=name.ru_ru,name.primary&query_by_weights=1,1' -H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" | jq ".hits[].document.name.ru_ru"
"Эйфелева башня"
primary first:
curl 'http://localhost:8108/collections/public_places/documents/search?q=%D0%AD%D0%B9%D1%84%D0%B5%D0%BB%D0%B5%D0%B2%D0%B0%20%D0%B1%D0%B0%D1%88%D0%BD%D1%8F&query_by=name.primary,name.ru_ru&query_by_weights=1,1' -H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" | jq ".hits[].document.name.ru_ru"
null
null
null
null
null
null
So it looks like it only considers the first field in the query_by list, however if I add extra weight to the second field it takes only results that match that one and not the other:
curl 'http://localhost:8108/collections/public_places/documents/search?q=%D0%AD%D0%B9%D1%84%D0%B5%D0%BB%D0%B5%D0%B2%D0%B0%20%D0%B1%D0%B0%D1%88%D0%BD%D1%8F&query_by=name.primary,name.ru_ru&query_by_weights=1,2' -H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" | jq ".hits[].document.name.ru_ru"
"Эйфелева башня"
Attaching schema & docs in 🧵Josh Handley
11/24/2025, 2:37 PMJosh Handley
11/24/2025, 3:04 PMJosh Handley
11/24/2025, 3:04 PMAlan Martini
11/25/2025, 10:17 PMJosh Handley
12/01/2025, 4:06 PM