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

Optionally indexing the addendum field based on the configuration. #487

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion configValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const Joi = require('@hapi/joi');
const schema = Joi.object().required().keys({
schema: Joi.object().required().keys({
indexName: Joi.string().required(),
typeName: Joi.string().required()
typeName: Joi.string().required(),
indexAddendumField: Joi.boolean()
}),
esclient: Joi.object().required()
}).unknown(true);
Expand Down
6 changes: 4 additions & 2 deletions mappings/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ const hash = require('./partial/hash');
const multiplier = require('./partial/multiplier');
const keyword = require('./partial/keyword');
const keyword_with_doc_values = require('./partial/keyword_with_doc_values');
const _ = require("lodash");
const peliasConfig = require('pelias-config').generate();

var schema = {
const schema = {
properties: {

// data partitioning
Expand Down Expand Up @@ -202,7 +204,7 @@ var schema = {
match_mapping_type: 'string',
mapping: {
type: 'keyword',
index: false,
index: _.get(peliasConfig, 'schema.indexAddendumField', false),
doc_values: false
}
}
Expand Down