Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Define index mappings from collection metadata #37

Merged
merged 5 commits into from
May 26, 2017

Conversation

leplatrem
Copy link
Contributor

@leplatrem leplatrem commented May 25, 2017

Ref #8

This is another approach to #36.

Since conversion from JSONSchema to ES mapping seems fragile. Let's take another curve and do something less smart but a lot simpler: read an explicit attribute index:schema in the collection metadata.

@glasserc @n1k0 @Natim @magopian Thoughts?

@leplatrem leplatrem force-pushed the 8-collection-indexschema branch from 00755e2 to a608cdd Compare May 25, 2017 16:16
"build": {
"properties": {
"date": {"type": "date", "format": "strict_date"},
"id": {"type": "keyword"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type: string

"last_modified": {"type": "long"},
"build": {
"properties": {
"date": {"type": "date", "format": "strict_date"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format: dateOptionalTime

mapping = self.get_mapping("bid", "cid")
assert mapping == {
"properties": {
"id": {"type": "keyword"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type: string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string field is unsupported for indexes created in 5.x in favor of the text and keyword fields.

Copy link
Member

@Natim Natim May 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so maybe the ES running on Travis is not up-to-date enough. You should try using the trusty image to run tests on travis.

https://github.com/Kinto/kinto/blob/master/.travis.yml#L1

@leplatrem leplatrem force-pushed the 8-collection-indexschema branch from 1f70534 to 5d52d58 Compare May 26, 2017 09:25
@leplatrem leplatrem merged commit 7963ed2 into master May 26, 2017
@leplatrem leplatrem deleted the 8-collection-indexschema branch May 26, 2017 10:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants