Closed Bug 947291 Opened 12 years ago Closed 12 years ago

Store localized versions of strings in ES

Categories

(Marketplace Graveyard :: Search, defect, P2)

Avenir
x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
2013-12-10

People

(Reporter: robhudson, Assigned: robhudson)

Details

Currently we are returning a JSON objects of $lang: value for certain fields in the app resource. But not under the search API because we're not storing these correctly. The `name`, `description`, `homepage`, `release_notes`, `support_email` and `support_url` fields are user-translated fields. The proposed plan: Store these in ES according to the following mapping example: 'homepage' { 'type': 'object', 'properties': { 'lang': {'type': 'string', 'index': 'not_analyzed'}, 'string': {'type': 'string', 'index': 'not_analyzed'}, } } On indexing, get all Translations for the field and index in ES. On output we'll need to collapse this into {lang: string} to match the AppResource API output. Note that name and description will also need to be stored via the SEARCH_ANALYZER_MAP analyzers so they are searchable, but for the rest of the fields the above can act as a simple storage/retrieval to avoid database hits and keep search fast.
Assignee: nobody → robhudson.mozbugs
Priority: -- → P2
Target Milestone: --- → 2013-12-10
2 commits so we can roll this out in pieces and update the index w/o breaking production: 1. https://github.com/mozilla/zamboni/commit/232e410 2. https://github.com/mozilla/zamboni/commit/a8a2cf9 To verify, try both of the following: 1. Add an app that has a translation on a field like "homepage". 2. Using the search API use a keyword that will find the app. 3. Ensure that the "homepage" field has all the translations expected. 1. Add an app that has a translation on a field like "homepage". 2. Using the search API use a keyword that will find the app and append "?lang=..." for the translation you want. 3. Ensure that the "homepage" field has only that translation expected.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.