Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to define mapping policy for new fields #502

Closed
wants to merge 10 commits into from

Conversation

Aschen
Copy link
Contributor

@Aschen Aschen commented Mar 7, 2019

What does this PR do ?

Allows the definition of the dynamic property for the mappings.
Now users have to specify the root property field for mappings:

{
  "dynamic": "true",
  "properties": {
    "age": { "type": "integer" },
    "name": { "type": "text" }
  }
}

This PR is related to kuzzleio/kuzzle#1257 but the admin console will work with older kuzzle version too.

How should this be manually tested?

Other changes

  • change error text to white

@codecov-io
Copy link

codecov-io commented Mar 8, 2019

Codecov Report

❗ No coverage uploaded for pull request base (2-dev@27f33c8). Click here to learn what that means.
The diff coverage is 45.45%.

Impacted file tree graph

@@           Coverage Diff            @@
##             2-dev     #502   +/-   ##
========================================
  Coverage         ?   81.39%           
========================================
  Files            ?       34           
  Lines            ?      774           
  Branches         ?        0           
========================================
  Hits             ?      630           
  Misses           ?      144           
  Partials         ?        0
Impacted Files Coverage Δ
src/vuex/modules/collection/actions.js 40% <ø> (ø)
src/vuex/modules/collection/getters.js 63.15% <0%> (ø)
src/services/collectionHelper.js 94.56% <55.55%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27f33c8...2924248. Read the comment docs.

@Aschen Aschen removed the wip label Mar 8, 2019
@@ -86,7 +86,7 @@
<div class="col s7 m8 l9" v-if="error">
<div class="card error red-color">
<i class="fa fa-times dismiss-error" @click="dismissError()"></i>
<p v-html="error"></p>
<p class="white-text" v-html="error"></p>
Copy link
Contributor

Choose a reason for hiding this comment

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

You add a white-text class here, and the css rule apply to .error-text. is it normal?
(the same for each error card you modified)

@@ -143,6 +143,9 @@
padding: 8px 12px;
margin: 0;
}
.error-text {
Copy link
Contributor

Choose a reason for hiding this comment

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

see previous

@Aschen Aschen added the wip label Mar 12, 2019
Aschen added a commit to kuzzleio/kuzzle that referenced this pull request Apr 25, 2019
Adds the ability to define the `dynamic` property for collection mapping.  
This property can take 3 values:
  - "true": Stores the document and updates the collection mapping with inferred type
  - "false": Stores the document and does not update the collection mapping (fields are not indexed)
  - "strict": Rejects document

See https://www.elastic.co/guide/en/elasticsearch/guide/current/dynamic-mapping.html

This is configurable in the `kuzzlerc` within the `server.db.dynamic` property.   
The default value is `true` which allows the user to push arbitrary documents to Kuzzle and Elasticsearch will try to infer the corresponding mapping. (This is the current behaviour in Kuzzle)

Admin-Console (wip): kuzzleio/kuzzle-admin-console#502

Documentation: kuzzleio/documentation#271

## Other changes

Fixed the usage of the `_meta` property for ES collection. This property must be passed to each call to `putMapping`.   
See #1268

chmod 777 on `node_modules/` because I'm tired of doing `sudo chmod +x node_modules/.bin/*` to run test locally
@Aschen Aschen closed this Jun 12, 2019
@Aschen Aschen deleted the add-ability-to-restrict-collection-mapping branch June 12, 2019 15:19
@Aschen Aschen restored the add-ability-to-restrict-collection-mapping branch September 23, 2019 09:06
@Aschen Aschen deleted the add-ability-to-restrict-collection-mapping branch September 23, 2019 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants