elasticsearch representation has bespoke keys

Bug #1194907 reported by Aaron Bentley on 2013-06-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charmworld
High
Abel Deuring

Bug Description

Elasticsearch is not a free-form data store; it uses a mapping, and that mapping has an entry for every unique key it encounters. This prevents pre-defining value types, which in turn leads to issues like bug #1176452. It also means that the mapping is so long that it is not human-readable. (The mapping for 10 charms turns out to be 1598 lines, pretty-printed.)

Instead, the representation given to elasticsearch should make all user-defined values *values*, not keys. For example:
{'foo': 'bar', 'baz': 'qux'} => [{'name': 'foo', 'value': 'bar'}, {'name': 'foo', 'value': 'qux'}]

Currently affected fields: "config.options" (but work in progress), "files", "provides", "requires", "peers".

When fixing files, it may make sense to address bug #1189992 at the same time.

Related branches

Aaron Bentley (abentley) on 2013-06-26
description: updated
Curtis Hovey (sinzui) on 2013-07-03
Changed in charmworld:
status: New → Triaged
importance: Undecided → High
Curtis Hovey (sinzui) on 2013-09-16
tags: added: elasticsearch
Curtis Hovey (sinzui) wrote :

Work on this bug has stalled. I don't think this is fixed because We need a list of the remaining user-created keys? I think options is fixed. The comments in charmworld.search imply that requires and provides use dynamic mapping. The files bug is still open.

On 16.09.2013 17:24, Curtis Hovey wrote:
> Work on this bug has stalled. I don't think this is fixed because We
> need a list of the remaining user-created keys? I think options is
> fixed. The comments in charmworld.search imply that requires and
> provides use dynamic mapping. The files bug is still open.
>

I think r393 should have fixed the bug.

Curtis Hovey (sinzui) wrote :

Oops. I was looking at a stake branch. I agree this is fixed in trunk.

Changed in charmworld:
assignee: nobody → Abel Deuring (adeuring)
status: Triaged → Fix Committed
Curtis Hovey (sinzui) on 2013-10-29
Changed in charmworld:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers