diff --git a/CHANGELOG.md b/CHANGELOG.md index 5527047ca..1b01c0956 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [4.2.0] +- New Kendra FAQ support (Beta version) using the setting KENDRA_FAQ_INDEX. New menu item in Designer UI to export Questions as a Kendra FAQ. See revised Blog Post for details. +- New GetSessionAttribute Handlebars helper to obtain session attribute. Works similar to lodash get(). Will not through exception and will return a default value. +- Enhanced handlebars to support string concatenation including handlevar 'variables' like Session Attributes and UserInfo, etc. Use case, e.g. to build a url containing a users email, eg a google calendar URL. Example of syntax now supported - in this case to dynamically build a personalized URL based on user info. {{setSessionAttr 'link' 'https://calendar.google.com/calendar/embed?src=' UserInfo.Email '&ctz=America%2FNew_York'}} +- Moved 'previous' and 'navigation' session attributes under a new 'qnabotcontext' session attribute so that Connect (and other) clients have fewer session attributes to preserve. +- Allows Chaining rule Lambda function to return a modified session object in addition to the string for chaining. +- Allows Chaining of up to 10 documents. Each document's Lambda hooks will also be invoked in sequence if defined. +- Added a new Repeat QID in the QNAUtility example package. Allows QnABot to easily repeat the last answer. +- Allow the chaining rule to specify a specific QID rather than an answer. A QID can be specified in the chaining rule by using string such as QID:: e.g. QID::Admin.001. Note, the new QID:: syntax can also be used from the webUI, say as button values if/when you prefer to target a specific QID (exact query) rather than rely on question matching. +- Fixed a defect to allow conditional chaining to be invoked after an elicit response bot failure. +- Upgrades to and installs ElasticSearch 7.7. + ## [4.1.0] - Install / Upgrade now supports the option to configure S3 Buckets and Elastic Search cluster using encryption at rest - Install / Upgrade now supports the option to require Cognito based user authorization to access the built-in full screen web UI (Public/Private parameter in template) - Public is the default diff --git a/README.md b/README.md index 695fa9622..bf5583413 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ This repository contains code for the QnABot, described in the AWS AI blog post See the "Getting Started" to launch your own QnABot +**New features in 4.2.0** [Beta Kendra FAQ Support, Bug fixes, Multiple document chaining, Repeat question, Elastic Search 7.7 upgrade](#new-features) + **New features in 4.1.0** [Encryption at rest for S3 and Elastic Search Cluster, option to require Cognito user pool authorization to access embedded web UI, enhanced Kendra integration, enhanced Connect integration, and others](#new-features) **New features in 4.0.0** [Update to Elasticsearch 7.4, improved question matching accuracy, fuzzy matching, new multi-language support debug setting, SSML for Amazon Connect, improved Kendra integration, full upgrade support](#new-features) @@ -152,6 +154,18 @@ See the [LICENSE.md](LICENSE.md) file for details ## New features +### Version 4.2.0 +- New Kendra FAQ support (Beta version) using the setting KENDRA_FAQ_INDEX. New menu item in Designer UI to export Questions as a Kendra FAQ. See revised Blog Post for details. +- New GetSessionAttribute Handlebars helper to obtain session attribute. Works similar to lodash get(). Will not through exception and will return a default value. +- Enhanced handlebars to support string concatenation including handlevar 'variables' like Session Attributes and UserInfo, etc. Use case, e.g. to build a url containing a users email, eg a google calendar URL. Example of syntax now supported - in this case to dynamically build a personalized URL based on user info. {{setSessionAttr 'link' 'https://calendar.google.com/calendar/embed?src=' UserInfo.Email '&ctz=America%2FNew_York'}} +- Moved 'previous' and 'navigation' session attributes under a new 'qnabotcontext' session attribute so that Connect (and other) clients have fewer session attributes to preserve. +- Allows Chaining rule Lambda function to return a modified session object in addition to the string for chaining. +- Allows Chaining of up to 10 documents. Each document's Lambda hooks will also be invoked in sequence if defined. +- Added a new Repeat QID in the QNAUtility example package. Allows QnABot to easily repeat the last answer. +- Allow the chaining rule to specify a specific QID rather than an answer. A QID can be specified in the chaining rule by using string such as QID:: e.g. QID::Admin.001. Note, the new QID:: syntax can also be used from the webUI, say as button values if/when you prefer to target a specific QID (exact query) rather than rely on question matching. +- Fixed a defect to allow conditional chaining to be invoked after an elicit response bot failure. +- Upgrades to and installs ElasticSearch 7.7. + ### Version 4.1.0 - Install / Upgrade now supports the option to configure S3 Buckets and Elastic Search cluster using encryption at rest - Install / Upgrade now supports the option to require Cognito based user authorization to access the built-in full screen web UI (Public/Private parameter in template) - Public is the default diff --git a/bin/config.js b/bin/config.js index a94e7c3ce..44ee715b3 100644 --- a/bin/config.js +++ b/bin/config.js @@ -20,7 +20,8 @@ module.exports={ "devEncryption": "UNENCRYPTED", "devPublicOrPrivate": "PUBLIC", "namespace":"dev", - "stackNamePrefix":"QNA" + "stackNamePrefix":"QNA", + "KendraFAQIndex":"" } if (require.main === module) { diff --git a/lambda/cfn/lib/S3Lambda.js b/lambda/cfn/lib/S3Lambda.js index ac908ebb5..bec5298fb 100644 --- a/lambda/cfn/lib/S3Lambda.js +++ b/lambda/cfn/lib/S3Lambda.js @@ -29,5 +29,9 @@ module.exports=class S3Lambda extends base{ Delete(ID,params,reply){ reply(null); } + + Update(ID,params,oldparams,reply){ + this.Create(params,reply) + } } diff --git a/lambda/cfn/package-lock.json b/lambda/cfn/package-lock.json index f905080cb..8c525cf9f 100644 --- a/lambda/cfn/package-lock.json +++ b/lambda/cfn/package-lock.json @@ -1960,9 +1960,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash._arraycopy": { "version": "3.0.0", diff --git a/lambda/cfn/package.json b/lambda/cfn/package.json index caf12b85d..67d8338ea 100644 --- a/lambda/cfn/package.json +++ b/lambda/cfn/package.json @@ -23,7 +23,7 @@ "json-stringify-pretty-compact": "^1.0.4", "jsonwebtoken": "^8.0.1", "jszip": "^3.1.4", - "lodash": "^4.17.15", + "lodash": "^4.17.19", "multer": "^1.3.0", "stack-utils": "^1.0.1" }, diff --git a/lambda/export/createFAQ.js b/lambda/export/createFAQ.js new file mode 100644 index 000000000..c7ae3cac5 --- /dev/null +++ b/lambda/export/createFAQ.js @@ -0,0 +1,239 @@ +// createFAQ.js + + +const AWSKendra = require('aws-sdk/clients/kendra'); +const AWSS3 = require('aws-sdk/clients/s3'); +const sleep = require('util').promisify(setTimeout) + + +/** + * Function to upload CSV to S3 bucket, return Promise + * @param s3Client + * @param params + * @returns {*} + */ +function s3Uploader(s3Client,params) { + return new Promise(function(resolve, reject) { + s3Client.putObject(params, function(err, data) { + if (err) { + console.log(err, err.stack); // an error occurred + reject(err); + } + else { + console.log('Uploaded CSV to S3 successfully:'); + console.log(data); // successful response + resolve(data); + } + }); + }); +} + + +/** + * Function to convert uploaded CSV into Kendra FAQ, return Promise + * @param kendraClient + * @param params + * @returns {*} + */ +function faqConverter(kendraClient,params) { + return new Promise(function(resolve, reject) { + kendraClient.createFaq(params, function(err, data) { + if (err) { + console.log(err, err.stack); // an error occurred + reject(err); + } + else { + console.log('Converted CSV to FAQ successfully:'); + console.log(data); // successful response + resolve(data); + } + }); + }); +} + + +/** + * Function to delete old FAQ from Kendra index, return Promise + * @param kendraClient + * @param params + * @returns {*} + */ +function faqDeleter(kendraClient,params) { + return new Promise(function(resolve, reject) { + kendraClient.deleteFaq(params, function(err, data) { + if (err) { + console.log(err, err.stack); // an error occurred + reject(err); + } + else { + console.log('Deleted old FAQ successfully. New list of FAQs in index ' + params.IndexId + ':'); + console.log(data); // successful response + resolve(data); + } + }); + }); +} + + +/** + * Function to list existing FAQs in a Kendra index, return Promise + * @param kendraClient + * @param params + * @returns {*} + */ +function faqLister(kendraClient,params) { + return new Promise(function(resolve, reject) { + kendraClient.listFaqs(params, function(err, data) { + if (err) { + console.log(err, err.stack); // an error occurred + reject(err); + } + else { + console.log('Checked for pre-existing FAQ successfully. List of FAQs for index ' + params.IndexId + ':'); + console.log(data); // successful response + resolve(data); + } + }); + }); +} + + + + +/** + * Function to upload CSV into S3 bucket and convert into Kendra FAQ, return Promise + * @returns {*} + */ +async function createFAQ(params) { + + // create kendra and s3 clients + let kendraClient = (process.env.REGION ? + new AWSKendra({apiVersion:'2019-02-03', region:process.env.REGION}) : + new AWSKendra({apiVersion:'2019-02-03', region:params.region}) + ); + let s3Client = (process.env.REGION ? + new AWSS3({apiVersion:'2006-03-01', region:process.env.REGION}) : + new AWSS3({apiVersion:'2006-03-01', region:params.region})); + console.log('clients created'); + + + // read in CSV and upload to S3 bucket + var fs = require('fs'); + var s3_params = { + Bucket: params.s3_bucket, + Key: params.s3_key, + ACL: 'bucket-owner-read', // TODO: should this param be public? + Body: fs.createReadStream(params.csv_path), // use read stream option in case file is large + }; + + let count=0; + while (count<1) { + try { + var s3_response = await s3Uploader(s3Client, s3_params); + count++; + } catch (error) { + if (error.code=='ThrottlingException') { + console.log(`Throttling exception: trying upload CSV again in 10 seconds`); + await sleep(10000); + continue; + } else { + throw error; + } + } + } + await sleep(10000); + + + // if FAQ exists already, delete the old one and update it + var index_params = { + IndexId: params.faq_index_id, + MaxResults: '30' // default max number of FAQs in developer edition + }; + + count=0; + while (count<1) { + try { + var list_faq_response = await faqLister(kendraClient, index_params); + count++; + } catch (error) { + if (error.code=='ThrottlingException') { + console.log(`Throttling exception: trying list FAQs again in 10 seconds`); + await sleep(10000); + continue; + } else { + throw error; + } + } + } + await sleep(10000); + + + var j, elem, index=null; + for (j=0; j { + return await createFAQ(params); +} diff --git a/lambda/export/index.js b/lambda/export/index.js index e9346247b..20d2b38ff 100644 --- a/lambda/export/index.js +++ b/lambda/export/index.js @@ -24,7 +24,8 @@ exports.step=function(event,context,cb){ .then(()=>s3.getObject({Bucket,Key,VersionId}).promise()) .then(x=>JSON.parse(x.Body.toString())) .then(function(config){ - if(config.status!=="Error" && config.status!=="Completed"){ + var step_status_ignore = ['Error', 'Completed', 'Sync Complete', 'Parsing content JSON', 'Creating FAQ'] + if (step_status_ignore.includes(config.status)===false) { return Promise.try(function(){ console.log("Config:",JSON.stringify(config,null,2)) switch(config.status){ diff --git a/lambda/export/kendraSync.js b/lambda/export/kendraSync.js new file mode 100644 index 000000000..a6e1cf40d --- /dev/null +++ b/lambda/export/kendraSync.js @@ -0,0 +1,163 @@ +var Promise=require('bluebird') +var aws=require("aws-sdk") +aws.config.setPromisesDependency(Promise) +aws.config.region=process.env.AWS_REGION + +var s3=new aws.S3({apiVersion: "2006-03-01", region:process.env.REGION}) +var _=require('lodash') +var parse=require('./parseJSON') +var create=require('./createFAQ') +const sleep = require('util').promisify(setTimeout) + + + +/** + * Function to check if a string has a JSON structure + * @param str + * @returns boolean + */ +function isJson(str) { + try { + JSON.parse(str); + } catch (e) { + return false; + } + return true; +} + +/** + * Function to get parameters from QnABot settings + * @param param_name + * @returns {*} + */ +async function get_parameter(param_name) { + var ssm = new aws.SSM(); + var params = { + Name: param_name, + }; + // TODO: update permissions + var response = await ssm.getParameter(params).promise(); + var settings = response.Parameter.Value + if (isJson(settings)) { + settings = JSON.parse(response.Parameter.Value); + } + return settings; +} + +/** + * Function to retrieve QnABot settings + * @returns {*} + */ +async function get_settings() { + var default_settings_param = process.env.DEFAULT_SETTINGS_PARAM; + var custom_settings_param = process.env.CUSTOM_SETTINGS_PARAM; + + console.log("Getting Default QnABot settings from SSM Parameter Store: ", default_settings_param); + var default_settings = await get_parameter(default_settings_param); + + console.log("Getting Custom QnABot settings from SSM Parameter Store: ", custom_settings_param); + var custom_settings = await get_parameter(custom_settings_param); + + var settings = _.merge(default_settings, custom_settings); + _.set(settings, "DEFAULT_USER_POOL_JWKS_URL"); + + console.log("Merged Settings: ", settings); + + if (settings.ENABLE_REDACTING.toLowerCase() === "true") { + console.log("redacting enabled"); + process.env.QNAREDACT="true"; + process.env.REDACTING_REGEX=settings.REDACTING_REGEX; + } else { + console.log("redacting disabled"); + process.env.QNAREDACT="false"; + process.env.REDACTING_REGEX=""; + } + return settings; +} + + +/** + * Function to perform Kendra Sync of exported QnABot content into FAQ + * @param event + * @param context + * @param cb + * @returns 'Synced' if successful + */ +exports.performSync=async function(event,context,cb){ + try{ + console.log("Request",JSON.stringify(event,null,2)) + var Bucket=event.Records[0].s3.bucket.name + var Key=decodeURI(event.Records[0].s3.object.key) + var VersionId=_.get(event,"Records[0].s3.object.versionId") + console.log(Bucket,Key) + + // triggered by export file, waits to be uploaded + await s3.waitFor('objectExists',{Bucket,Key,VersionId}).promise() + let x = await s3.getObject({Bucket,Key,VersionId}).promise() + var content = x.Body.toString() + + // parse JSON into CSV + var parseJSONparams = { + csv_name:'qna_FAQ.csv', + content:content, + output_path:'/tmp/qna_FAQ.csv', + } + await update_status(process.env.OUTPUT_S3_BUCKET, 'Parsing content JSON'); + await parse.handler(parseJSONparams) + console.log("Parsed content JSON into CSV stored locally"); + + + // get QnABot settings to retrieve KendraFAQIndex + var settings = await get_settings(); + var kendra_faq_index = _.get(settings, 'KENDRA_FAQ_INDEX', ""); + if (kendra_faq_index == "") { + throw new Error(`No FAQ Index set: ${kendra_faq_index}`); + } + console.log(`kendra faq index is ${kendra_faq_index}`); + + // create kendra FAQ from csv + var createFAQparams = { + faq_name:'qna-facts', + faq_index_id:kendra_faq_index, + csv_path:parseJSONparams.output_path, + csv_name:parseJSONparams.csv_name, + s3_bucket:process.env.OUTPUT_S3_BUCKET, + s3_key:"kendra_csv" + "/" + parseJSONparams.csv_name, + kendra_s3_access_role:process.env.KENDRA_ROLE, + region:process.env.REGION + } + await update_status(process.env.OUTPUT_S3_BUCKET, 'Creating FAQ'); + await create.handler(createFAQparams); + // wait for index to complete creation + // TODO: https://docs.aws.amazon.com/kendra/latest/dg/create-index.html + console.log('Completed CSV converting to FAQ'); + + + await update_status(process.env.OUTPUT_S3_BUCKET, 'Sync Complete'); + console.log(`completed sync`); + return 'Synced'; + + } catch (err) { + await update_status(process.env.OUTPUT_S3_BUCKET, 'Error'); + console.log(err); + console.log(`failed sync`); + return err + } +} + + +async function update_status(bucket, new_stat) { + var status_params = { + Bucket:bucket, + Key:'status/qna-kendra-faq.txt' + } + + // TODO: check the return value of the object in case of an error... + var x = await s3.getObject(status_params).promise(); + var config = JSON.parse(x.Body.toString()); + config.status = new_stat; + status_params.Body = JSON.stringify(config); + x = await s3.putObject(status_params).promise(); + console.log('updated config file status to ' + new_stat); + return x; +} \ No newline at end of file diff --git a/lambda/export/package-lock.json b/lambda/export/package-lock.json index 8d61fd96f..fefce8d25 100644 --- a/lambda/export/package-lock.json +++ b/lambda/export/package-lock.json @@ -4,11 +4,393 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array.prototype.map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", + "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.4" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chokidar": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.3.0" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "csv-parser": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/csv-parser/-/csv-parser-2.3.3.tgz", + "integrity": "sha512-czcyxc4/3Tt63w0oiK1zsnRgRD4PkqWaRSJ6eef63xC0f+5LVLuGdSYEcJwGp2euPgRHx+jmlH2Lb49anb1CGQ==", + "requires": { + "minimist": "^1.2.0", + "through2": "^3.0.1" + } + }, + "csv-writer": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/csv-writer/-/csv-writer-1.6.0.tgz", + "integrity": "sha512-NOx7YDFWEsM/fTRAJjRpPp8t+MKRVvniAg9wQlUKx20MFrPs73WLJhFf5iteqrxNYnsy924K3Iroh3yNHeYd2g==" + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==" + }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "requires": { + "is-buffer": "~2.0.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, "intercept-stdout": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/intercept-stdout/-/intercept-stdout-0.1.2.tgz", @@ -17,10 +399,133 @@ "lodash.toarray": "^3.0.0" } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" + }, + "is-callable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==" + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==" + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==" + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==" + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "iterate-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", + "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==" + }, + "iterate-value": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", + "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", + "requires": { + "es-get-iterator": "^1.0.2", + "iterate-iterator": "^1.0.1" + } + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash._arraycopy": { "version": "3.0.0", @@ -66,6 +571,446 @@ "lodash._basevalues": "^3.0.0", "lodash.keys": "^3.0.0" } + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "requires": { + "chalk": "^2.4.2" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "mocha": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", + "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", + "requires": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.3.1", + "debug": "3.2.6", + "diff": "4.0.2", + "escape-string-regexp": "1.0.5", + "find-up": "4.1.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", + "minimatch": "3.0.4", + "ms": "2.1.2", + "object.assign": "4.1.0", + "promise.allsettled": "1.0.2", + "serialize-javascript": "3.0.0", + "strip-json-comments": "3.0.1", + "supports-color": "7.1.0", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.0.0", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + }, + "promise.allsettled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", + "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", + "requires": { + "array.prototype.map": "^1.0.1", + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "iterate-value": "^1.0.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdirp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "requires": { + "picomatch": "^2.0.7" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "save-dev": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/save-dev/-/save-dev-0.0.1-security.tgz", + "integrity": "sha512-k6knZTDNK8PKKbIqnvxiOveJinuw2LcQjqDoaorZWP9M5AR2EPsnpDeSbeoZZ0pHr5ze1uoaKdK8NBGQrJ34Uw==" + }, + "serialize-javascript": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", + "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==" + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "requires": { + "has-flag": "^4.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + } + } + }, + "through2": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "2 || 3" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "workerpool": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", + "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==" + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" + } } } } diff --git a/lambda/export/package.json b/lambda/export/package.json index 8ebbd71a4..25bb2e8b3 100644 --- a/lambda/export/package.json +++ b/lambda/export/package.json @@ -3,14 +3,20 @@ "version": "1.0.0", "description": "", "main": "index.js", - "scripts": { - "test": "nodeunit test.js" - }, "author": "", "license": "ISC", "dependencies": { "bluebird": "^3.5.1", + "csv-parser": "^2.3.3", + "csv-writer": "^1.6.0", + "intercept-stdout": "^0.1.2", "lodash": "^4.17.15", + "mocha": "^8.0.1", + "save-dev": "0.0.1-security" + }, + "scripts": { + "test": "mocha", + "lodash": "^4.17.19", "intercept-stdout": "^0.1.2" } } diff --git a/lambda/export/parseJSON.js b/lambda/export/parseJSON.js new file mode 100644 index 000000000..04502927f --- /dev/null +++ b/lambda/export/parseJSON.js @@ -0,0 +1,46 @@ +// parseJSON.js + +/** + * Function to parse JSON of configurations/questions from QNA Content Designer and write an output CSV file + * @param input_path : the input file path of the exported JSON + * @param output_path : the output file path to write the CSV + * @returns output_path + */ +async function qnaJsonParser(params) { + const createCsvWriter = require('csv-writer').createObjectCsvWriter; + const csvWriter = createCsvWriter({ + path: params.output_path, + header: [ + {id: 'question', title: 'Question'}, + {id: 'answer', title: 'Answer'}, + {id: 'link', title: 'Document URL (optional)'}, + ] + }); + + var qna = `{"qna":[${params.content.toString().replace(/\n/g,',\n')}]}` + params.content = JSON.parse(qna); + const q_list = params.content.qna; + + const data = []; + q_list.forEach(function(elem) { + var json_doc = JSON.stringify(elem); // puts entire JSON structure in URL field + if (elem.q) { // qna type questions (standard) + elem.q.forEach(function(ques){ + var entry = {question:ques, answer:elem.a, link:json_doc}; + data.push(entry); + }) + } else { + console.log(`this element is not supported with KendraFAQ and was skipped in the sync: ${JSON.stringify(elem)}`); + } + + }); + + return csvWriter + .writeRecords(data) + .then(()=> console.log('The CSV file ' + params.output_path + ' was written successfully')); + +} + +exports.handler = async (params) => { + return await qnaJsonParser(params); +}; \ No newline at end of file diff --git a/lambda/export/test/automateSyncTest.js b/lambda/export/test/automateSyncTest.js new file mode 100644 index 000000000..a3845d813 --- /dev/null +++ b/lambda/export/test/automateSyncTest.js @@ -0,0 +1,88 @@ +var assert = require('assert'); + +// json parsing test +async function test_parser() { + const parseJSON = require('../parseJSON.js'); + const fs = require('fs') + let content; + + fs.readFile('./qna-kendra-faq.txt', (err, data) => { + if (err) throw err; + content = data; + console.log(`data is ${data.toString()}`); + }) + // var content = `{"qna":[${qna.toString().replace(/\n/g,',\n')}]}` + // content = JSON.parse(content); + + var parseJSONparams = { + csv_name:'qna_FAQ.csv', + content:content, + output_path:'./test/qna_FAQ.csv', + } + const resp = await parseJSON.handler(parseJSONparams); + + try { + if (fs.existsSync(parseJSONparams.output_path)) { + return true; + } else { + return false; + } + } catch(err) { + console.error(err) + return false; + } + // ALERT: does not check rows of CSV, so must manually validate content and format +} + + +// create FAQ test +async function test_create_faq() { + const create = require('../createFAQ.js'); + var content = require('./qna_FAQ.json'); + var parseJSONparams = { + csv_name:'qna_FAQ.csv', + content:content, + output_path:'./test/qna_FAQ.csv', + } + var createFAQparams = { + faq_name:'qna-facts', + faq_index_id:'e1c23860-e5c8-4409-ae26-b05bd6ced00a', + csv_path:parseJSONparams.output_path, + csv_name:parseJSONparams.csv_name, + s3_bucket:'qna-dev-dev-dev-master-5-exportbucket-yj1v0yw9u094', + s3_key:"kendra-data" + "/" + parseJSONparams.csv_name, + kendra_s3_access_role:'arn:aws:iam::425742325899:role/QNA-dev-dev-dev-master-5-ExportStack-KendraS3Role-7966TLAABU2N', + region:'us-east-1' + } + return create.handler(createFAQparams); +} + +//performSync test +async function test_performSync() { + const kendraSync = require('../kendraSync.js'); + const event = require('./syncEvent.json'); + var context = undefined; + var cb = undefined; + process.env.OUTPUT_S3_BUCKET = 'qna-dev-dev-dev-master-5-exportbucket-yj1v0yw9u094' + process.env.KENDRA_INDEX = 'e1c23860-e5c8-4409-ae26-b05bd6ced00a'; + process.env.KENDRA_ROLE = 'arn:aws:iam::425742325899:role/QNA-dev-dev-dev-master-5-ExportStack-KendraS3Role-7966TLAABU2N' + return kendraSync.performSync(event, context, cb); +} + +describe('#test automate-sync()', () => { + // it('test_json_parser', async function() { + // let resp = await test_parser(); + // assert.equal(resp, true); + // }); + + it('test_create_faq', async function() { + let resp = await test_create_faq(); + assert(resp, 'Failed to create FAQ'); + }); + + // it('test_perform_sync', async function() { + // let resp = await test_performSync(); + // assert(resp, 'Synced'); + // }); +}); + diff --git a/lambda/export/test/qna-kendra-faq.txt b/lambda/export/test/qna-kendra-faq.txt new file mode 100644 index 000000000..a38373658 --- /dev/null +++ b/lambda/export/test/qna-kendra-faq.txt @@ -0,0 +1,10 @@ +{"qid":"KendraFallback","a":"The Kendra Fallback search was not able to identify any results","l":"QNA:EXTKendraFallback","type":"qna","q":["no_hits_alternative"]} +{"a":"I am the QnA bot, ask me a question and I will try my best to answer it.","qid":"Help","type":"qna","q":["help","help me","need help"]} +{"a":"Thank you for your feedback - we will try to improve this answer.","qid":"Feedback.001","args":["incorrect"],"l":"QNA:ExamplePYTHONLambdaFeedback","next":"","r":{"subTitle":"","title":"","url":"","text":"","imageUrl":"","buttons":[{"text":"","value":""}]},"t":"","alt":{"ssml":"","markdown":""},"type":"qna","q":["Thumbs down","Bad answer"]} +{"qid":"stats.2","a":"Correlation is a measure of the strength of a linear relationship.","type":"qna","q":["Define correlation"]} +{"qid":"stats.4","a":"P(A or B) = P(A) + P(B) - P(A and B)","type":"qna","q":["What is the general addition theory?"]} +{"qid":"stats.5","a":"The normal distribution, also known as the Gaussian distribution, is a type of continuous probability distribution for a real-valued random variable. It is a perfectly symmetric distribution that extends to both infinities defined by two parameters, its mean and standard deviation.","type":"qna","q":["What is a normal distribution?"]} +{"qid":"stats.1","a":"There are two types of categorical variables: ordinal and nominal variables. Ordinal variables have natural, ordered categories and the distances between the categories is not known. They exist on scales, such as socioeconomic status, education level, or satisfaction rating. Nominal variables take on qualitative values representing different categories, and there is no intrinsic ordering of these categories, like gender or name.","type":"qna","q":["What are the types of categorical variables?"]} +{"qid":"stats.3","a":"There are 2 main methods to calculate the expected value of a random variable. Firstly, you could use the definition: the expectation of a random variable is the probability of an event multiplied by the amount of times the event happens. Alternatively, you can use expectation by conditioning: define the random variable in terms of another, and condition on it. Then find the conditional expectation in terms of the other variable, and finally find the expectation.","type":"qna","q":["How do I calculate expectation?"]} +{"a":"Thank you for your positive feedback on this answer, your feedback helps us continuously improve.","qid":"Feedback.002","args":["correct"],"l":"QNA:ExamplePYTHONLambdaFeedback","type":"qna","q":["Thumbs up","Good answer"]} +{"a":"{{Settings.EMPTYMESSAGE}}","qid":"CustomNoMatches","type":"qna","q":["no_hits"]} \ No newline at end of file diff --git a/lambda/export/test/qna_FAQ.csv b/lambda/export/test/qna_FAQ.csv new file mode 100644 index 000000000..394b6c61d --- /dev/null +++ b/lambda/export/test/qna_FAQ.csv @@ -0,0 +1,17 @@ +Question,Answer,Document URL (optional) +Will the Sun ever consume the earth?,"When all the Hydrogen has been burned, the Sun will continue for about 130 million more years. During this time, it is consuming Helium and will expand to engulf Mercury, Venus, and the Earth. It is now a red giant.","{""next"":"""",""args"":[""""],""a"":""When all the Hydrogen has been burned, the Sun will continue for about 130 million more years. During this time, it is consuming Helium and will expand to engulf Mercury, Venus, and the Earth. It is now a red giant."",""r"":{""subTitle"":"""",""imageUrl"":"""",""title"":""""},""t"":"""",""alt"":{""markdown"":"""",""ssml"":""""},""l"":"""",""qid"":""sun.4"",""type"":""qna"",""selected"":false,""q"":[""Will the Sun ever consume the earth?""]}" +How large is the sun?,"The Sun is 109 times wider than the Earth and 330,000 times as massive","{""a"":""The Sun is 109 times wider than the Earth and 330,000 times as massive"",""r"":{""subTitle"":""Image referenced from space-facts.com"",""imageUrl"":""https://space-facts.com/wp-content/uploads/sun-size.png"",""title"":""Image""},""qid"":""sun.6"",""type"":""qna"",""q"":[""How large is the sun?""]}" +How hot is it at the center of the Sun?,At its centre the Sun reaches temperatures of 15 million °C.,"{""args"":[""""],""next"":"""",""a"":""At its centre the Sun reaches temperatures of 15 million °C."",""r"":{""buttons"":[{""text"":""How far away is the sun?"",""value"":""How far away is the sun?""}],""subTitle"":""Image referenced from solarsystem.nasa.gov"",""imageUrl"":""https://solarsystem.nasa.gov/system/resources/detail_files/823_cover-1920_detail.jpg"",""title"":""Sun Image"",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":""# Sun Temp\n* It has a surface temperature of 5,500 degrees C\n* At its centre the Sun reaches temperatures of **15 million °C**."",""ssml"":""\nAt its centre the Sun reaches temperatures of 15 million °C\n""},""l"":"""",""qid"":""sun.3"",""type"":""qna"",""q"":[""How hot is it at the center of the Sun?""]}" +Tell me about the sun?,"Our sun is 4.6 billion years old. Its considered a yellow dwarf with a diameter of 1,392,684 kilometers and a circumference of 4,370,005 kilometers. It has a mass that is equal to 333,060 earths and a surface temperature of 5,500 degrees celsius. Really Hot!","{""args"":[""""],""next"":"""",""a"":""Our sun is 4.6 billion years old. Its considered a yellow dwarf with a diameter of 1,392,684 kilometers and a circumference of 4,370,005 kilometers. It has a mass that is equal to 333,060 earths and a surface temperature of 5,500 degrees celsius. Really Hot!"",""r"":{""buttons"":[{""text"":""How hot is the sun"",""value"":""How hot is the sun""}],""subTitle"":"""",""imageUrl"":"""",""title"":""Options"",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":""## Some facts\n* Our sun is 4.6 billion years old\n* It is considered a yellow dwarf\n* It has a mass that is equal to 333,060 earths"",""ssml"":"" Our Sun is 4.6 billion years old. It is considered a yellow dwarf and has a mass that is equal to 333,060 earths.""},""l"":"""",""qid"":""sun.1"",""type"":""qna"",""q"":[""Tell me about the sun?""]}" +How old is the Sun?,Our Sun is 4.6 billion years old.,"{""args"":[""""],""next"":"""",""a"":""Our Sun is 4.6 billion years old."",""r"":{""buttons"":[{""text"":"""",""value"":""""}],""subTitle"":"""",""imageUrl"":"""",""title"":"""",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":"""",""ssml"":""""},""l"":"""",""qid"":""sun.2"",""type"":""qna"",""q"":[""How old is the Sun?""]}" +How far away is the sun?,"The sun is 149,598,262 km (1 AU) from earth.","{""args"":[""""],""next"":"""",""a"":""The sun is 149,598,262 km (1 AU) from earth."",""r"":{""buttons"":[{""text"":""How large is the sun?"",""value"":""How large is the sun?""}],""subTitle"":""Image referenced from blogspot.com"",""imageUrl"":""https://3.bp.blogspot.com/-EQIjUw2H3To/WZvsoY4IrlI/AAAAAAAABIs/-iXnUDigA1cK2iZ9dV6AFp3v-P8kD_eewCLcBGAs/s1600/earthorbit.gif"",""title"":""Map""},""t"":"""",""alt"":{""markdown"":""### Distance\n\nThe sun is 149,598,262 km or 1 astronomical unit from the earth"",""ssml"":""""},""l"":"""",""qid"":""sun.5"",""type"":""qna"",""selected"":false,""q"":[""How far away is the sun?"",""What distance is the sun from the earth?""]}" +What distance is the sun from the earth?,"The sun is 149,598,262 km (1 AU) from earth.","{""args"":[""""],""next"":"""",""a"":""The sun is 149,598,262 km (1 AU) from earth."",""r"":{""buttons"":[{""text"":""How large is the sun?"",""value"":""How large is the sun?""}],""subTitle"":""Image referenced from blogspot.com"",""imageUrl"":""https://3.bp.blogspot.com/-EQIjUw2H3To/WZvsoY4IrlI/AAAAAAAABIs/-iXnUDigA1cK2iZ9dV6AFp3v-P8kD_eewCLcBGAs/s1600/earthorbit.gif"",""title"":""Map""},""t"":"""",""alt"":{""markdown"":""### Distance\n\nThe sun is 149,598,262 km or 1 astronomical unit from the earth"",""ssml"":""""},""l"":"""",""qid"":""sun.5"",""type"":""qna"",""selected"":false,""q"":[""How far away is the sun?"",""What distance is the sun from the earth?""]}" +What other locations on the internet have information about the sun?,Here is one place on the web you can go: https://solarsystem.nasa.gov/solar-system/sun/overview/.,"{""args"":[""""],""next"":"""",""a"":""Here is one place on the web you can go: https://solarsystem.nasa.gov/solar-system/sun/overview/."",""r"":{""buttons"":[{""text"":"""",""value"":""""}],""subTitle"":"""",""imageUrl"":"""",""title"":""Options""},""t"":"""",""alt"":{""markdown"":""[Nasa](https://solarsystem.nasa.gov/solar-system/sun/overview/ \""Nasa's Sun Page\"") is also a great source of information on the Sun."",""ssml"":""""},""l"":"""",""qid"":""sun.7"",""type"":""qna"",""selected"":false,""q"":[""What other locations on the internet have information about the sun?""]}" +What are solar flares?,"A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions.","{""args"":[""""],""next"":"""",""a"":""A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions."",""r"":{""buttons"":[{""text"":"""",""value"":""""}],""subTitle"":"""",""imageUrl"":"""",""title"":"""",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":""A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions. [NASA Definition](https://www.nasa.gov/content/goddard/what-is-a-solar-flare 'Solar Flare')"",""ssml"":""A brief eruption of intense high-energy radiation from the sun's surface.""},""l"":"""",""qid"":""sun.9"",""type"":""qna"",""q"":[""What are solar flares?"",""what is a solar flare?"",""Define solar flares."",""I'd like to know more about solar flares.""]}" +what is a solar flare?,"A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions.","{""args"":[""""],""next"":"""",""a"":""A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions."",""r"":{""buttons"":[{""text"":"""",""value"":""""}],""subTitle"":"""",""imageUrl"":"""",""title"":"""",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":""A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions. [NASA Definition](https://www.nasa.gov/content/goddard/what-is-a-solar-flare 'Solar Flare')"",""ssml"":""A brief eruption of intense high-energy radiation from the sun's surface.""},""l"":"""",""qid"":""sun.9"",""type"":""qna"",""q"":[""What are solar flares?"",""what is a solar flare?"",""Define solar flares."",""I'd like to know more about solar flares.""]}" +Define solar flares.,"A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions.","{""args"":[""""],""next"":"""",""a"":""A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions."",""r"":{""buttons"":[{""text"":"""",""value"":""""}],""subTitle"":"""",""imageUrl"":"""",""title"":"""",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":""A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions. [NASA Definition](https://www.nasa.gov/content/goddard/what-is-a-solar-flare 'Solar Flare')"",""ssml"":""A brief eruption of intense high-energy radiation from the sun's surface.""},""l"":"""",""qid"":""sun.9"",""type"":""qna"",""q"":[""What are solar flares?"",""what is a solar flare?"",""Define solar flares."",""I'd like to know more about solar flares.""]}" +I'd like to know more about solar flares.,"A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions.","{""args"":[""""],""next"":"""",""a"":""A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions."",""r"":{""buttons"":[{""text"":"""",""value"":""""}],""subTitle"":"""",""imageUrl"":"""",""title"":"""",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":""A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions. [NASA Definition](https://www.nasa.gov/content/goddard/what-is-a-solar-flare 'Solar Flare')"",""ssml"":""A brief eruption of intense high-energy radiation from the sun's surface.""},""l"":"""",""qid"":""sun.9"",""type"":""qna"",""q"":[""What are solar flares?"",""what is a solar flare?"",""Define solar flares."",""I'd like to know more about solar flares.""]}" +How many planets orbit the Sun?,"Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto.","{""args"":[""""],""next"":"""",""a"":""Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto."",""r"":{""buttons"":[{""text"":""What is a solar flare?"",""value"":""What is a solar flare""}],""subTitle"":"""",""imageUrl"":"""",""title"":""Suggestions"",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":"""",""ssml"":""""},""l"":"""",""qid"":""sun.10"",""type"":""qna"",""q"":[""How many planets orbit the Sun?"",""Which planets orbit the Sun?""]}" +Which planets orbit the Sun?,"Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto.","{""args"":[""""],""next"":"""",""a"":""Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto."",""r"":{""buttons"":[{""text"":""What is a solar flare?"",""value"":""What is a solar flare""}],""subTitle"":"""",""imageUrl"":"""",""title"":""Suggestions"",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":"""",""ssml"":""""},""l"":"""",""qid"":""sun.10"",""type"":""qna"",""q"":[""How many planets orbit the Sun?"",""Which planets orbit the Sun?""]}" +What is the diameter of the Sun?,The Sun's diameter is 1.4 million kilometers.,"{""args"":[""""],""next"":"""",""a"":""The Sun's diameter is 1.4 million kilometers."",""r"":{""buttons"":[{""text"":""How many planets orbit the Sun?"",""value"":""How many planets orbit the Sun""}],""subTitle"":"""",""imageUrl"":"""",""title"":""Suggestions"",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":"""",""ssml"":""""},""l"":"""",""qid"":""sun.11"",""type"":""qna"",""q"":[""What is the diameter of the Sun?"",""How wide is the sun?""]}" +How wide is the sun?,The Sun's diameter is 1.4 million kilometers.,"{""args"":[""""],""next"":"""",""a"":""The Sun's diameter is 1.4 million kilometers."",""r"":{""buttons"":[{""text"":""How many planets orbit the Sun?"",""value"":""How many planets orbit the Sun""}],""subTitle"":"""",""imageUrl"":"""",""title"":""Suggestions"",""text"":"""",""url"":""""},""t"":"""",""alt"":{""markdown"":"""",""ssml"":""""},""l"":"""",""qid"":""sun.11"",""type"":""qna"",""q"":[""What is the diameter of the Sun?"",""How wide is the sun?""]}" diff --git a/lambda/export/test/qna_FAQ.json b/lambda/export/test/qna_FAQ.json new file mode 100644 index 000000000..59f5c4dd7 --- /dev/null +++ b/lambda/export/test/qna_FAQ.json @@ -0,0 +1,293 @@ +{ + "qna": [ + { + "next": "", + "args": [ + "" + ], + "a": "When all the Hydrogen has been burned, the Sun will continue for about 130 million more years. During this time, it is consuming Helium and will expand to engulf Mercury, Venus, and the Earth. It is now a red giant.", + "r": { + "subTitle": "", + "imageUrl": "", + "title": "" + }, + "t": "", + "alt": { + "markdown": "", + "ssml": "" + }, + "l": "", + "qid": "sun.4", + "type": "qna", + "selected": false, + "q": [ + "Will the Sun ever consume the earth?" + ] + }, + { + "a": "The Sun is 109 times wider than the Earth and 330,000 times as massive", + "r": { + "subTitle": "Image referenced from space-facts.com", + "imageUrl": "https://space-facts.com/wp-content/uploads/sun-size.png", + "title": "Image" + }, + "qid": "sun.6", + "type": "qna", + "q": [ + "How large is the sun?" + ] + }, + { + "args": [ + "" + ], + "next": "", + "a": "At its centre the Sun reaches temperatures of 15 million °C.", + "r": { + "buttons": [ + { + "text": "How far away is the sun?", + "value": "How far away is the sun?" + } + ], + "subTitle": "Image referenced from solarsystem.nasa.gov", + "imageUrl": "https://solarsystem.nasa.gov/system/resources/detail_files/823_cover-1920_detail.jpg", + "title": "Sun Image", + "text": "", + "url": "" + }, + "t": "", + "alt": { + "markdown": "# Sun Temp\n* It has a surface temperature of 5,500 degrees C\n* At its centre the Sun reaches temperatures of **15 million °C**.", + "ssml": "\nAt its centre the Sun reaches temperatures of 15 million °C\n" + }, + "l": "", + "qid": "sun.3", + "type": "qna", + "q": [ + "How hot is it at the center of the Sun?" + ] + }, + { + "args": [ + "" + ], + "next": "", + "a": "Our sun is 4.6 billion years old. Its considered a yellow dwarf with a diameter of 1,392,684 kilometers and a circumference of 4,370,005 kilometers. It has a mass that is equal to 333,060 earths and a surface temperature of 5,500 degrees celsius. Really Hot!", + "r": { + "buttons": [ + { + "text": "How hot is the sun", + "value": "How hot is the sun" + } + ], + "subTitle": "", + "imageUrl": "", + "title": "Options", + "text": "", + "url": "" + }, + "t": "", + "alt": { + "markdown": "## Some facts\n* Our sun is 4.6 billion years old\n* It is considered a yellow dwarf\n* It has a mass that is equal to 333,060 earths", + "ssml": " Our Sun is 4.6 billion years old. It is considered a yellow dwarf and has a mass that is equal to 333,060 earths." + }, + "l": "", + "qid": "sun.1", + "type": "qna", + "q": [ + "Tell me about the sun?" + ] + }, + { + "args": [ + "" + ], + "next": "", + "a": "Our Sun is 4.6 billion years old.", + "r": { + "buttons": [ + { + "text": "", + "value": "" + } + ], + "subTitle": "", + "imageUrl": "", + "title": "", + "text": "", + "url": "" + }, + "t": "", + "alt": { + "markdown": "", + "ssml": "" + }, + "l": "", + "qid": "sun.2", + "type": "qna", + "q": [ + "How old is the Sun?" + ] + }, + { + "args": [ + "" + ], + "next": "", + "a": "The sun is 149,598,262 km (1 AU) from earth.", + "r": { + "buttons": [ + { + "text": "How large is the sun?", + "value": "How large is the sun?" + } + ], + "subTitle": "Image referenced from blogspot.com", + "imageUrl": "https://3.bp.blogspot.com/-EQIjUw2H3To/WZvsoY4IrlI/AAAAAAAABIs/-iXnUDigA1cK2iZ9dV6AFp3v-P8kD_eewCLcBGAs/s1600/earthorbit.gif", + "title": "Map" + }, + "t": "", + "alt": { + "markdown": "### Distance\n\nThe sun is 149,598,262 km or 1 astronomical unit from the earth", + "ssml": "" + }, + "l": "", + "qid": "sun.5", + "type": "qna", + "selected": false, + "q": [ + "How far away is the sun?", + "What distance is the sun from the earth?" + ] + }, + { + "args": [ + "" + ], + "next": "", + "a": "Here is one place on the web you can go: https://solarsystem.nasa.gov/solar-system/sun/overview/.", + "r": { + "buttons": [ + { + "text": "", + "value": "" + } + ], + "subTitle": "", + "imageUrl": "", + "title": "Options" + }, + "t": "", + "alt": { + "markdown": "[Nasa](https://solarsystem.nasa.gov/solar-system/sun/overview/ \"Nasa's Sun Page\") is also a great source of information on the Sun.", + "ssml": "" + }, + "l": "", + "qid": "sun.7", + "type": "qna", + "selected": false, + "q": [ + "What other locations on the internet have information about the sun?" + ] + }, + { + "args": [ + "" + ], + "next": "", + "a": "A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions.", + "r": { + "buttons": [ + { + "text": "", + "value": "" + } + ], + "subTitle": "", + "imageUrl": "", + "title": "", + "text": "", + "url": "" + }, + "t": "", + "alt": { + "markdown": "A brief eruption of intense high-energy radiation from the sun's surface, associated with sunspots and causing electromagnetic disturbances on the earth, as with radio frequency communications and power line transmissions. [NASA Definition](https://www.nasa.gov/content/goddard/what-is-a-solar-flare 'Solar Flare')", + "ssml": "A brief eruption of intense high-energy radiation from the sun's surface." + }, + "l": "", + "qid": "sun.9", + "type": "qna", + "q": [ + "What are solar flares?", + "what is a solar flare?", + "Define solar flares.", + "I'd like to know more about solar flares." + ] + }, + { + "args": [ + "" + ], + "next": "", + "a": "Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto.", + "r": { + "buttons": [ + { + "text": "What is a solar flare?", + "value": "What is a solar flare" + } + ], + "subTitle": "", + "imageUrl": "", + "title": "Suggestions", + "text": "", + "url": "" + }, + "t": "", + "alt": { + "markdown": "", + "ssml": "" + }, + "l": "", + "qid": "sun.10", + "type": "qna", + "q": [ + "How many planets orbit the Sun?", + "Which planets orbit the Sun?" + ] + }, + { + "args": [ + "" + ], + "next": "", + "a": "The Sun's diameter is 1.4 million kilometers.", + "r": { + "buttons": [ + { + "text": "How many planets orbit the Sun?", + "value": "How many planets orbit the Sun" + } + ], + "subTitle": "", + "imageUrl": "", + "title": "Suggestions", + "text": "", + "url": "" + }, + "t": "", + "alt": { + "markdown": "", + "ssml": "" + }, + "l": "", + "qid": "sun.11", + "type": "qna", + "q": [ + "What is the diameter of the Sun?", + "How wide is the sun?" + ] + } + ] +} \ No newline at end of file diff --git a/lambda/export/test/qna_stats.json b/lambda/export/test/qna_stats.json new file mode 100644 index 000000000..371e08f41 --- /dev/null +++ b/lambda/export/test/qna_stats.json @@ -0,0 +1,54 @@ +{ + "qna": [ + { + "a": "I am the QnA bot, ask me a question and I will try my best to answer it.", + "qid": "Help", + "type": "qna", + "q": [ + "help", + "help me", + "need help" + ] + }, + { + "qid": "stats.2", + "a": "Correlation is a measure of the strength of a linear relationship.", + "type": "qna", + "q": [ + "Define correlation" + ] + }, + { + "qid": "stats.4", + "a": "P(A or B) = P(A) + P(B) - P(A and B)", + "type": "qna", + "q": [ + "What is the general addition theory?" + ] + }, + { + "qid": "stats.5", + "a": "The normal distribution, also known as the Gaussian distribution, is a type of continuous probability distribution for a real-valued random variable. It is a perfectly symmetric distribution that extends to both infinities defined by two parameters, its mean and standard deviation.", + "type": "qna", + "q": [ + "What is a normal distribution?" + ] + }, + { + "qid": "stats.1", + "a": "There are two types of categorical variables: ordinal and nominal variables. Ordinal variables have natural, ordered categories and the distances between the categories is not known. They exist on scales, such as socioeconomic status, education level, or satisfaction rating. Nominal variables take on qualitative values representing different categories, and there is no intrinsic ordering of these categories, like gender or name.", + "type": "qna", + "q": [ + "What are the types of categorical variables?" + ] + }, + { + "qid": "stats.3", + "a": "There are 2 main methods to calculate the expected value of a random variable. Firstly, you could use the definition: the expectation of a random variable is the probability of an event multiplied by the amount of times the event happens. Alternatively, you can use expectation by conditioning: define the random variable in terms of another, and condition on it. Then find the conditional expectation in terms of the other variable, and finally find the expectation.", + "type": "qna", + "q": [ + "How do I calculate expectation?" + ] + } + ] +} \ No newline at end of file diff --git a/lambda/export/test/syncEvent.json b/lambda/export/test/syncEvent.json new file mode 100644 index 000000000..0cc3a4da1 --- /dev/null +++ b/lambda/export/test/syncEvent.json @@ -0,0 +1,38 @@ +{ + "Records": [ + { + "eventVersion": "2.0", + "eventSource": "aws:s3", + "awsRegion": "us-east-1", + "eventTime": "1970-01-01T00:00:00.000Z", + "eventName": "ObjectCreated:Put", + "userIdentity": { + "principalId": "EXAMPLE" + }, + "requestParameters": { + "sourceIPAddress": "127.0.0.1" + }, + "responseElements": { + "x-amz-request-id": "EXAMPLE123456789", + "x-amz-id-2": "EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH" + }, + "s3": { + "s3SchemaVersion": "1.0", + "configurationId": "testConfigRule", + "bucket": { + "name": "qna-dev-dev-dev-master-4-exportbucket-o5r0tsjifuu9", + "ownerIdentity": { + "principalId": "425742325899" + }, + "arn": "arn:aws:s3:::qna-dev-dev-dev-master-4-exportbucket-o5r0tsjifuu9" + }, + "object": { + "key": "kendra-data/qna-kendra-faq.txt", + "size": 1024, + "eTag": "ea5f317edb95c13611cea52d30f056b6", + "sequencer": "0A1B2C3D4E5F678901" + } + } + } + ] +} \ No newline at end of file diff --git a/lambda/fulfillment/lib/middleware/1_parse.js b/lambda/fulfillment/lib/middleware/1_parse.js index 17527dc9d..6907111f1 100644 --- a/lambda/fulfillment/lib/middleware/1_parse.js +++ b/lambda/fulfillment/lib/middleware/1_parse.js @@ -165,5 +165,9 @@ module.exports = async function parse(req, res) { url: "" } }) + // ensure res.session.qnabotcontext exists + if ( ! _.get(res,"session.qnabotcontext")) { + _.set(res,"session.qnabotcontext",{}) ; + } return { req, res } } \ No newline at end of file diff --git a/lambda/fulfillment/lib/middleware/3_query.js b/lambda/fulfillment/lib/middleware/3_query.js index 1479d178a..fdb932ad8 100644 --- a/lambda/fulfillment/lib/middleware/3_query.js +++ b/lambda/fulfillment/lib/middleware/3_query.js @@ -53,7 +53,7 @@ module.exports=async function query(req,res) { console.log('Handling elicitResponse'); let resp = await lexRouter.elicitResponse(req,res, elicitResponse); let progress = _.get(resp,"res.session.qnabotcontext.elicitResponse.progress", undefined); - if (progress === 'Fulfilled' || progress === 'ReadyForFulfillment') { + if (progress === 'Fulfilled' || progress === 'ReadyForFulfillment' || progress === 'Failed') { console.log("Bot was fulfilled"); // LexBot has completed. See if we need to using chaining to go to another question if (chainingConfig) { @@ -126,7 +126,8 @@ module.exports=async function query(req,res) { _.set(postQuery,'res.session.qnabotcontext.elicitResponse.responsebot',responsebot_hook) _.set(postQuery,'res.session.qnabotcontext.elicitResponse.namespace',responsebot_session_namespace) _.set(postQuery,'res.session.qnabotcontext.elicitResponse.chainingConfig',chaining_configuration) - _.set(postQuery.res.session, postQuery.res.session.elicitResponseNamespace + ".boterror", undefined ); + _.set(postQuery.res.session, responsebot_session_namespace + ".boterror", undefined ); + _.set(postQuery.res.session, responsebot_session_namespace, {} ); } console.log("Standard path return from 3_query: " + JSON.stringify(postQuery, null, 2)); diff --git a/lambda/fulfillment/lib/middleware/4_hook.js b/lambda/fulfillment/lib/middleware/4_hook.js index f888533b1..8f78210e5 100644 --- a/lambda/fulfillment/lib/middleware/4_hook.js +++ b/lambda/fulfillment/lib/middleware/4_hook.js @@ -2,14 +2,36 @@ var _=require('lodash') var util=require('./util') module.exports = async function hook(req,res) { - var arn=util.getLambdaArn(_.get(res.result,"l","")) - if(arn){ - return await util.invokeLambda({ - FunctionName:arn, - req,res - }) - }else{ - return {req,res} + // handle list of lambda hooks, from possible qid merge after conditional chaining + var lambdahooks = _.get(res.result, "lambdahooks",[]); + // no lambdahooks array (no previous chaining), so initialise array from 'l' and 'args' fields + if ( lambdahooks.length == 0 ) { + lambdahooks = [ + { + l: _.get(res.result, "l"), + args: _.get(res.result, "args",[]), + } + ]; } + + var event = {req,res}; + var i=0; + while (i Args: ", lambdahooks[i].args); + let arn=util.getLambdaArn(lambdahooks[i].l); + if (arn) { + event = await util.invokeLambda({ + FunctionName:arn, + req:event.req, + res:event.res + }) ; + } + } + i=i+1 ; + } + return event; } diff --git a/lambda/fulfillment/lib/middleware/lexRouter.js b/lambda/fulfillment/lib/middleware/lexRouter.js index 2742bee69..13585cbc5 100644 --- a/lambda/fulfillment/lib/middleware/lexRouter.js +++ b/lambda/fulfillment/lib/middleware/lexRouter.js @@ -107,15 +107,21 @@ async function handleRequest(req, res, botName, botAlias) { async function processResponse(req, res, hook, msg) { function indicateFailure(req, res, errmsg) { - res.message = errmsg; - res.plainMessage = errmsg; - _.set(res.session,res.session.elicitResponseNamespace + '.boterror','true'); + let namespace = _.get(res,'session.qnabotcontext.elicitResponse.namespace', undefined); + if (namespace) { + _.set(res.session,namespace + '.boterror','true'); + } _.set(res,'session.qnabotcontext.elicitResponse.progress','Failed'); _.set(res,'session.qnabotcontext.elicitResponse.responsebot',undefined); - _.set(res,'session.qnabotcontext.elicitResponse.chainingConfig',undefined); _.set(res,'session.qnabotcontext.elicitResponse.namespace',undefined); _.set(res,'session.qnabotcontext.elicitResponse.loopCount',0); res.card = undefined; + + let chainingConfig = _.get(res,'session.qnabotcontext.elicitResponse.chainingConfig',undefined); + if (chainingConfig === undefined) { + res.message = errmsg; + res.plainMessage = errmsg; + } } const maxElicitResponseLoopCount = _.get(req, '_settings.ELICIT_RESPONSE_MAX_RETRIES', 5); @@ -130,7 +136,7 @@ async function processResponse(req, res, hook, msg) { ssmlMessage = botResp.message ; plainMessage = plainMessage.replace(/<\/?[^>]+(>|$)/g, ""); } - let elicitResponseLoopCount =_.get(res,"session.qnabotcontext.elicitResponse.loopCount"); + let elicitResponseLoopCount =_.get(res,"session.qnabotcontext.elicitResponse.loopCount", 0); if (botResp.dialogState === 'ConfirmIntent') { _.set(res,'session.qnabotcontext.elicitResponse.progress','ConfirmIntent'); res.plainMessage = plainMessage; @@ -164,7 +170,7 @@ async function processResponse(req, res, hook, msg) { if (elicitResponseLoopCount >= maxElicitResponseLoopCount) { indicateFailure(req, res, _.get(req, '_settings.ELICIT_RESPONSE_BOT_FAILURE_MESSAGE', 'Your response was not understood. Please start again.')); } else { - _.set(res,'session.qnabotcontext.elicitResponse.progress',botResp.dialogState); + _.set(res,'session.qnabotcontext.elicitResponse.progress','ErrorHandling'); res.message = elicit_Response_Retry_Message; res.plainMessage = elicit_Response_Retry_Message; res.card = undefined; diff --git a/lambda/fulfillment/lib/middleware/multilanguage.js b/lambda/fulfillment/lib/middleware/multilanguage.js index 56ffd3be0..92a8b7d89 100644 --- a/lambda/fulfillment/lib/middleware/multilanguage.js +++ b/lambda/fulfillment/lib/middleware/multilanguage.js @@ -88,22 +88,26 @@ async function set_translated_transcript(locale, req) { const detectedLocale = SessionAttributes.userDetectedLocale; const detectedSecondaryLocale = SessionAttributes.userDetectedSecondaryLocale; - if (locale === 'en' && detectedLocale === 'en' && detectedSecondaryLocale === undefined) { - console.log("No translation - english detected"); - } else if (locale === 'en' && detectedLocale === 'en' && detectedSecondaryLocale) { - console.log("translate to english using secondary detected locale: ", req.question); - const translation = await get_translation(req.question, detectedSecondaryLocale, 'en'); - _.set(req, "_translation", translation.TranslatedText); - _.set(req, "question", translation.TranslatedText); - console.log("Overriding input question with translation: ", req.question); - } else if (locale !== '' && locale.charAt(0) !== '%' && detectedLocale && detectedLocale !== '') { - console.log("Confidence in the detected language high enough."); - const translation = await get_translation(req.question, detectedLocale, 'en'); - _.set(req, "_translation", translation.TranslatedText); - _.set(req, "question", translation.TranslatedText); - console.log("Overriding input question with translation: ", req.question); - } else { - console.log ('not possible to perform language translation') + if ( ! req.question.toLowerCase().startsWith("qid::")) { + if (locale === 'en' && detectedLocale === 'en' && detectedSecondaryLocale === undefined) { + console.log("No translation - english detected"); + } else if (locale === 'en' && detectedLocale === 'en' && detectedSecondaryLocale) { + console.log("translate to english using secondary detected locale: ", req.question); + const translation = await get_translation(req.question, detectedSecondaryLocale, 'en'); + _.set(req, "_translation", translation.TranslatedText); + _.set(req, "question", translation.TranslatedText); + console.log("Overriding input question with translation: ", req.question); + } else if (locale !== '' && locale.charAt(0) !== '%' && detectedLocale && detectedLocale !== '') { + console.log("Confidence in the detected language high enough."); + const translation = await get_translation(req.question, detectedLocale, 'en'); + _.set(req, "_translation", translation.TranslatedText); + _.set(req, "question", translation.TranslatedText); + console.log("Overriding input question with translation: ", req.question); + } else { + console.log ('not possible to perform language translation') + } + } else { + console.log("Question targeting specified Qid (starts with QID::) - skip translation"); } } diff --git a/lambda/import/package-lock.json b/lambda/import/package-lock.json index 8d61fd96f..e7688c505 100644 --- a/lambda/import/package-lock.json +++ b/lambda/import/package-lock.json @@ -18,9 +18,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash._arraycopy": { "version": "3.0.0", diff --git a/lambda/import/package.json b/lambda/import/package.json index 8ebbd71a4..edc24ee40 100644 --- a/lambda/import/package.json +++ b/lambda/import/package.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "bluebird": "^3.5.1", - "lodash": "^4.17.15", + "lodash": "^4.17.19", "intercept-stdout": "^0.1.2" } } diff --git a/lambda/lex-build/package-lock.json b/lambda/lex-build/package-lock.json index ba62dd7ce..3c0ce02b6 100644 --- a/lambda/lex-build/package-lock.json +++ b/lambda/lex-build/package-lock.json @@ -1128,9 +1128,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash._arraycopy": { "version": "3.0.0", diff --git a/lambda/lex-build/package.json b/lambda/lex-build/package.json index f6b5cd18a..07d98e5d9 100644 --- a/lambda/lex-build/package.json +++ b/lambda/lex-build/package.json @@ -15,7 +15,7 @@ "elasticsearch": "^16.7.1", "http-aws-es": "^6.0.0", "intercept-stdout": "^0.1.2", - "lodash": "^4.17.15" + "lodash": "^4.17.19" }, "devDependencies": { "nodeunit": "^0.11.3", diff --git a/lambda/proxy-es/index.js b/lambda/proxy-es/index.js index d46690d67..296d2253b 100644 --- a/lambda/proxy-es/index.js +++ b/lambda/proxy-es/index.js @@ -23,7 +23,7 @@ exports.resource=require('./lib/cfn').resource exports.query=function(event,context,callback){ require('./lib/query')(event.req,event.res) - .then(()=>callback(null,event)) + .then((x)=>callback(null,x)) .catch(callback) } diff --git a/lambda/proxy-es/lib/HANDLEBARS_README.md b/lambda/proxy-es/lib/HANDLEBARS_README.md index 13b981ac4..f44e55ecd 100644 --- a/lambda/proxy-es/lib/HANDLEBARS_README.md +++ b/lambda/proxy-es/lib/HANDLEBARS_README.md @@ -51,7 +51,8 @@ QnABot also provides these additional helpers: |Helper | Descr | Example | |------------------------|--------------------------------------------|---------------------------------------------------------------------------------------------| |ifCond | Block helper for conditional output.
Supported comparison operators:
'==', '===', '!=' ,'!==', '<', '<=', '>', '>=', '&&','||' |{{#ifCond LexOrAlexa '==' 'LEX'}}
_output if true_
{{else}}
_output if false_
{{/ifCond}}
| -|setSessionAttr | Sets a named session attribute to specified value. | {{setSessionAttr '_testAttrName_' '_value_'}} | +|getSessionAttr | Returns named session attribute value if it is defined, or default value. | {{getSessionAttr '_attrName_' '_default_'}} | +|setSessionAttr | Sets a named session attribute to specified value. | {{setSessionAttr '_attrName_' '_value_'}} | |randomPick | Randomly return a string selected from a list. | {{randomPick
"Greetings."
"Hi there!"
"Howdy"
"Hello, how are you?"
"Whassup dude!"
}}| ## Comments @@ -84,6 +85,9 @@ Ask me a question. Try to stump me. Done {{/if}} +{{!-- get nested Session Attribute, or default if attribute doesn't exist or is not defined --}} +Previous answer was {{getSessionAttr 'qnabotcontext.previous.a' 'No previous response'}} + {{!-- pick a random answer from list below --}} {{randomPick "Greetings." diff --git a/lambda/proxy-es/lib/esbodybuilder.js b/lambda/proxy-es/lib/esbodybuilder.js index 33dacba8f..645fc73cf 100644 --- a/lambda/proxy-es/lib/esbodybuilder.js +++ b/lambda/proxy-es/lib/esbodybuilder.js @@ -5,6 +5,18 @@ var get_keywords=require('./keywords'); var _=require('lodash'); +function build_qid_query(params) { + console.log("Build_qid_query - params: ",JSON.stringify(params,null,2)); + var query=bodybuilder() + .orQuery('match','qid',params.qid) + .from(0) + .size(1) + .build(); + console.log("ElasticSearch Query",JSON.stringify(query,null,2)); + return new Promise.resolve(query); +} + + function build_query(params) { console.log("Build_query - params: ",JSON.stringify(params,null,2)); return(get_keywords(params)) @@ -56,7 +68,14 @@ function build_query(params) { module.exports=function(params){ - return build_query(params); + // if question starts with "QID::" then build a Qid targeted query, else build question matching query. + if (params.question.toLowerCase().startsWith("qid::")) { + // question specifies targeted Qid + params.qid = params.question.split("::")[1] ; + return build_qid_query(params); + } else { + return build_query(params); + } }; diff --git a/lambda/proxy-es/lib/handlebars.js b/lambda/proxy-es/lib/handlebars.js index 6efc9451c..e959f2ef5 100644 --- a/lambda/proxy-es/lib/handlebars.js +++ b/lambda/proxy-es/lib/handlebars.js @@ -117,12 +117,23 @@ Handlebars.registerHelper('setLang', function (lang, last, options) { } }); -Handlebars.registerHelper('setSessionAttr', function (k, v, options) { +Handlebars.registerHelper('setSessionAttr', function () { + let args = Array.from(arguments); + const k = args[0]; + // concat remaining arguments to create value + const v_arr = args.slice(1, args.length - 1); // ignore final 'options' argument + const v = v_arr.join(""); // concatenate value arguments console.log("Setting res session attribute:", k, " Value:", v); _.set(res_glbl.session, k, v); return ""; }); +Handlebars.registerHelper('getSessionAttr', function (attr, def, options) { + let v = _.get(res_glbl.session, attr, def); + console.log("Return session attribute key, value: ", attr, v); + return v; +}); + Handlebars.registerHelper('randomPick', function () { var argcount = arguments.length - 1; // ignore final 'options' argument console.log("Select randomly from ", argcount, "inputs: ", arguments); @@ -155,6 +166,7 @@ var apply_handlebars = async function (req, res, hit) { var markdown = _.get(hit, "alt.markdown"); var ssml = _.get(hit, "alt.ssml"); var r = _.get(hit, "r"); + // catch and log errors before throwing exception. if (a) { try { @@ -238,7 +250,6 @@ var apply_handlebars = async function (req, res, hit) { console.log("ERROR: response card fields format caused Handlebars exception. Check syntax: " + e ); throw (e); } - } console.log("Preprocessed Result: ", hit_out); return hit_out; diff --git a/lambda/proxy-es/lib/handler.js b/lambda/proxy-es/lib/handler.js index a1f4edbf3..b22ecd8f9 100644 --- a/lambda/proxy-es/lib/handler.js +++ b/lambda/proxy-es/lib/handler.js @@ -3,15 +3,45 @@ var Promise=require('bluebird'); var request=require('./request'); var _=require('lodash'); var build_es_query=require('./esbodybuilder'); +var kendra = require('./kendraQuery'); var AWS=require('aws-sdk'); + +function isJson(str) { + try { + JSON.parse(str); + } catch (e) { + return false; + } + return true; +} + +function str2bool(settings) { + var new_settings = _.mapValues(settings, x => { + if (_.isString(x)) { + if (x.toLowerCase() === "true") { + return true ; + } + if (x.toLowerCase() === "false") { + return false ; + } + } + return x; + }); + return new_settings; +} + async function get_parameter(param_name) { var ssm = new AWS.SSM(); var params = { Name: param_name, }; var response = await ssm.getParameter(params).promise(); - var settings = JSON.parse(response.Parameter.Value); + var settings = response.Parameter.Value + if (isJson(settings)) { + settings = JSON.parse(response.Parameter.Value); + settings = str2bool(settings) ; + } return settings; } @@ -21,17 +51,28 @@ async function get_settings() { console.log("Getting Default QnABot settings from SSM Parameter Store: ", default_settings_param); var default_settings = await get_parameter(default_settings_param); - + console.log("Getting Custom QnABot settings from SSM Parameter Store: ", custom_settings_param); var custom_settings = await get_parameter(custom_settings_param); var settings = _.merge(default_settings, custom_settings); + console.log("Merged Settings: ", settings); - return settings; + + if (settings.ENABLE_REDACTING) { + console.log("redacting enabled"); + process.env.QNAREDACT="true"; + process.env.REDACTING_REGEX=settings.REDACTING_REGEX; + } else { + console.log("redacting disabled"); + process.env.QNAREDACT="false"; + process.env.REDACTING_REGEX=""; + } + return settings; } -async function get_es_query(event) { - var settings = await get_settings(); + +async function get_es_query(event, settings) { var question = _.get(event,'question',''); if (question.length > 0) { var query_params = { @@ -53,25 +94,62 @@ async function get_es_query(event) { } } -module.exports= (event, context, callback) => { + + +async function run_query_es(event, settings) { + console.log("ElasticSearch Query",JSON.stringify(es_query,null,2)); + var es_query = await get_es_query(event, settings); + var es_response = await request({ + url:Url.resolve("https://"+event.endpoint,event.path), + method:event.method, + headers:event.headers, + body:es_query + }); + return es_response; +} + + +async function run_query_kendra(event, kendra_index) { + console.log("Kendra FAQ Query index:" + kendra_index); + var request_params = { + kendra_faq_index:kendra_index, + input_transcript:event.question, + size:10 // limit kendra hits to 10 max to avoid pagination issues + } + var kendra_response = await kendra.handler(request_params); + return kendra_response; +} + + + + +module.exports= async (event, context, callback) => { console.log('Received event:', JSON.stringify(event, null, 2)); - return(Promise.resolve(get_es_query(event))) - .then( function(es_query) { - console.log("ElasticSearch Query",JSON.stringify(es_query,null,2)); - return request({ - url:Url.resolve("https://"+event.endpoint,event.path), - method:event.method, - headers:event.headers, - body:es_query - }); - }) - .tap(x=>console.log(JSON.stringify(x))) - .tapCatch(x=>console.log(x)) - .then(result=>callback(null,result)) - .catch(error=>callback(JSON.stringify({ - type:error.response.status===404 ? "[NotFoud]" : "[InternalServiceError]", - status:error.response.status, - message:error.response.statusText, - data:error.response.data - }))); -}; + try { + var settings = await get_settings(); + var kendra_index = _.get(settings, "KENDRA_FAQ_INDEX") + var question = _.get(event,'question',''); + if (question.length > 0 && kendra_index != "") { + var response = await run_query_kendra(event, kendra_index); + // ES fallback if KendraFAQ fails + var hit = _.get(response, "hits.hits[0]._source"); + if (!hit && _.get(settings, 'KENDRA_FAQ_ES_FALLBACK', false)){ + console.log("ES Fallback"); + response = await run_query_es(event, settings); + } + } else { + var response = await run_query_es(event, settings); + } + + console.log("Query response: ", JSON.stringify(response,null,2)); + return callback(null, response); + } catch (error) { + console.log(`error is ${JSON.stringify(error, null,2)}`); + return callback(JSON.stringify({ + type:error.response.status===404 ? "[NotFound]":"[InternalServiceError]", + status:error.response.status, + message:error.response.statusText, + data:error.response.data + })) + } +} diff --git a/lambda/proxy-es/lib/kendraQuery.js b/lambda/proxy-es/lib/kendraQuery.js new file mode 100644 index 000000000..0dd073927 --- /dev/null +++ b/lambda/proxy-es/lib/kendraQuery.js @@ -0,0 +1,190 @@ +/** + * optional environment variables - These are not used defined during setup of this function in QnABot but are + * useful for testing if defined. + * + * REGION - optional AWS region to target + * + */ + +var _ = require('lodash'); +const AWS = require('aws-sdk'); + +/** + * Function to query kendraClient and return results via Promise + * @param kendraClient + * @param params + * @param resArray + * @returns {*} + */ +function kendraRequester(kendraClient,params,resArray) { + return new Promise(function(resolve, reject) { + kendraClient.query(params, function(err, data) { + let indexId = params.IndexId; + if (err) { + console.log(err, err.stack); + reject('Error from Kendra query request:' + err); + } + else { + data.originalKendraIndexId = indexId; + console.log("Data from Kendra request:" + JSON.stringify(data, null, 2)); + resArray.push(data); + resolve(data); + } + }); + }); +} + + +/** Function that returns if a string has JSON structure + * @param str - input string + * @returns boolean true or false + */ +function hasJsonStructure(str) { + if (typeof str !== 'string') return false; + try { + const result = JSON.parse(str); + const type = Object.prototype.toString.call(result); + return type === '[object Object]' + || type === '[object Array]'; + } catch (err) { + return false; + } +} + + + +/** Function that processes kendra requests and handles response. Decides whether to handle SNS + * events or Lambda Hook events from QnABot. + * @param request - request parameters object +// * @param event - input event passed to the Lambda Handler +// * @param context - input context passed to the Lambda Handler + * @returns {Promise<*>} - returns the response in event.res + */ +async function routeKendraRequest(request_params) { + + AWS.config.update({ + maxRetries: request_params.maxRetries, + retryDelayOptions: { + base: request_params.retryDelay + }, + }); + + var kendraClient = (process.env.REGION ? + new AWS.Kendra({apiVersion: '2019-02-03', region: process.env.REGION}) : + new AWS.Kendra({apiVersion: '2019-02-03'}) + ); + + + let promises = []; + let resArray = []; + let kendraIndexes = undefined; + let kendraFaqIndex = request_params.kendra_faq_index; + if (kendraFaqIndex != "" && kendraFaqIndex != undefined) { + kendraIndexes = [kendraFaqIndex]; + } else { + throw new Error("Undefined KendraFAQIndex: " + kendraFaqIndex); + } + // Iterate through this area and perform queries against Kendra. + kendraIndexes.forEach(function (index, i) { + const params = { + IndexId: index, /* required */ + QueryText: request_params.input_transcript + }; + let p = kendraRequester(kendraClient,params,resArray); + promises.push(p); + }); + await Promise.all(promises); + + + // ----- process kendra query responses and update answer content ----- + + /* default message text - can be overridden using QnABot SSM Parameter Store Custom Property */ + let foundAnswerCount = 0; + let kendraQueryId; + let kendraIndexId; + let kendraResultId; + let json_struct = []; + + + // note that this outside for loop will only execute once (one FAQ index) but the structure was kept due to its elegance + resArray.forEach(function (res) { + if (res && res.ResultItems && res.ResultItems.length > 0) { + + var i, element; + for (i=0; i 1) { + + if (!hasJsonStructure(element.DocumentURI)) { + break; + } + var hit = JSON.parse(element.DocumentURI); + console.log(`hit is ${JSON.stringify(hit)}`); + json_struct.push(hit); + + kendraQueryId = res.QueryId; // store off the QueryId to use as a session attribute for feedback + kendraIndexId = res.originalKendraIndexId; // store off the Kendra IndexId to use as a session attribute for feedback + kendraResultId = element.Id; // store off resultId to use as a session attribute for feedback + foundAnswerCount++; + } + }; + } + }); + + // return query response structure to make Kendra results look like ES results so we don't have to change the UI + var hits_struct = { + // "took": 104, + "timed_out": false, + "hits": { + "total": { + "value": foundAnswerCount, // if no answers found, total hits # is 0 and hits list is empty + "relation": "eq" + }, + "max_score": json_struct.length, + "hits": [], + }, + } + if (kendraQueryId) { + hits_struct.kendra_context = { + "kendraQueryId":kendraQueryId, + "kendraIndexId":kendraIndexId, + "kendraResultId":kendraResultId, + "kendraResponsibleQid":"KendraFAQ" + } + } + + + let ans = {}; + var j, faq_struct; + var num=json_struct.length; + if (request_params.size) { + num = Math.min(num, request_params.size); + } + for (j=0; j0) { + hits_struct['kendraResultsCached'] = resArray[0]; + } + + console.log("RETURN: " + JSON.stringify(hits_struct)); + return hits_struct; +} + +exports.handler = async (request_params) => { + console.log("kendra query request: " + JSON.stringify(request_params)); + return routeKendraRequest(request_params); +}; diff --git a/lambda/proxy-es/lib/logging.js b/lambda/proxy-es/lib/logging.js index 4662bac98..1008aadea 100644 --- a/lambda/proxy-es/lib/logging.js +++ b/lambda/proxy-es/lib/logging.js @@ -35,13 +35,13 @@ function stringifySessionAttribues(res) { } } -module.exports=function(req,res){ +module.exports=function(event, context, callback){ //data to send to general metrics logging var date = new Date() var now = date.toISOString() // need to unwrap the request and response objects we actually want from the req object - var unwrappedReq =req.req - var unwrappedRes =req.res + var unwrappedReq =event.req + var unwrappedRes =event.res // response session attributes logged as JSON string values to avoid // ES mapping errors. @@ -55,9 +55,9 @@ module.exports=function(req,res){ let re = new RegExp(redactRegex, "g"); processKeysForRegEx(unwrappedReq, re); processKeysForRegEx(unwrappedRes, re); - console.log("RESULT",JSON.stringify(req).replace(re, 'XXXXX'),JSON.stringify(res).replace(re, 'XXXXX')); + console.log("RESULT",JSON.stringify(event).replace(re, 'XXXXX')); } else { - console.log("RESULT",JSON.stringify(req),JSON.stringify(res)); + console.log("RESULT",JSON.stringify(event)); } let jsonData = { diff --git a/lambda/proxy-es/lib/query.js b/lambda/proxy-es/lib/query.js index 261d3b893..e6b3d8173 100755 --- a/lambda/proxy-es/lib/query.js +++ b/lambda/proxy-es/lib/query.js @@ -6,21 +6,101 @@ var request = require('./request'); var build_es_query = require('./esbodybuilder'); var handlebars = require('./handlebars'); var translate = require('./translate'); +var kendra = require('./kendraQuery'); +// const sleep = require('util').promisify(setTimeout); + // use DEFAULT_SETTINGS_PARAM as random encryption key unique to this QnABot installation var key = _.get(process.env, "DEFAULT_SETTINGS_PARAM", "fdsjhf98fd98fjh9 du98fjfd 8ud8fjdf"); var encryptor = require('simple-encryptor')(key); async function run_query(req, query_params) { + var onlyES = await isESonly(req, query_params); + + // runs kendra query if question supported on Kendra and KENDRA_FAQ_INDEX is set + if (!onlyES && _.get(req, "_settings.KENDRA_FAQ_INDEX")!=""){ + return await run_query_kendra(req, query_params); + } else { + return await run_query_es(req, query_params); + } +} + +async function isESonly(req, query_params) { + // returns boolean whether question is supported only on ElasticSearch + // no_hits is ES only + var no_hits_question = _.get(req, '_settings.ES_NO_HITS_QUESTION', 'no_hits'); + var ES_only_questions = [no_hits_question]; + if (ES_only_questions.includes(query_params['question'])) { + return true + } + // QID querying is ES only + if (query_params.question.toLowerCase().startsWith("qid::")) { + return true + } + // setting topics is ES only + if (_.get(query_params, 'topic')!="") { + return true + } + return false; +} + +async function run_query_es(req, query_params) { + var es_query = await build_es_query(query_params); var es_response = await request({ url: `https://${req._info.es.address}/${req._info.es.index}/_doc/_search?search_type=dfs_query_then_fetch`, method: "GET", body: es_query }); + + if (_.get(es_response, "hits.hits[0]._source")) { + _.set(es_response, "hits.hits[0]._source.answersource", "ElasticSearch"); + } + return es_response; } + +async function run_query_kendra(req, query_params) { + console.log("Querying Kendra FAQ index: " + _.get(req, "_settings.KENDRA_FAQ_INDEX")); + // calls kendrQuery function which duplicates KendraFallback code, but only searches through FAQs + var request_params = { + kendra_faq_index:_.get(req, "_settings.KENDRA_FAQ_INDEX"), + maxRetries:_.get(req, "_settings.KENDRA_FAQ_CONFIG_MAX_RETRIES"), + retryDelay:_.get(req, "_settings.KENDRA_FAQ_CONFIG_RETRY_DELAY"), + } + // autotranslate + if (req["_event"]['userDetectedLocale'] != 'en') { + request_params['input_transcript'] = query_params.question; + } else { + request_params['input_transcript']= req["_event"].inputTranscript; + } + + // optimize kendra queries for throttling by checking if KendraFallback idxs include KendraFAQIndex + let alt_kendra_idxs = _.get(req, "_settings.ALT_SEARCH_KENDRA_INDEXES"); + if (alt_kendra_idxs && alt_kendra_idxs.length) { + try { + // parse JSON array of kendra indexes + alt_kendra_idxs = JSON.parse(alt_kendra_idxs); + } catch (err) { + // assume setting is a string containing single index + alt_kendra_idxs = [ alt_kendra_idxs ]; + } + } + if (alt_kendra_idxs.includes(request_params.kendra_faq_index)) { + console.log(`optimizing for KendraFallback`); + request_params['same_index'] = true + } + + var kendra_response = await kendra.handler(request_params); + + if (_.get(kendra_response, "hits.hits[0]._source")) { + _.set(kendra_response, "hits.hits[0]._source.answersource", "Kendra FAQ"); + } + return kendra_response; + +} + function merge_next(hit1, hit2) { if (hit1 === undefined) { return hit2; @@ -31,16 +111,16 @@ function merge_next(hit1, hit2) { hit2.a = hit1.a + hit2.a; } // merge markdown, if present in both items - var md1 = (_.get(hit1, "alt.markdown")); - var md2 = (_.get(hit2, "alt.markdown")); + var md1 = _.get(hit1, "alt.markdown"); + var md2 = _.get(hit2, "alt.markdown"); if (md1 && md2) { _.set(hit2, "alt.markdown", md1 + "\n" + md2); } else { console.log("Markdown field missing from one or both items; skip markdown merge"); } // merge SSML, if present in both items - var ssml1 = (_.get(hit1, "alt.ssml")); - var ssml2 = (_.get(hit2, "alt.ssml")); + var ssml1 = _.get(hit1, "alt.ssml"); + var ssml2 = _.get(hit2, "alt.ssml"); if (ssml1 && ssml2) { // strip tags ssml1 = ssml1.replace(/|<\/speak>/g, ""); @@ -50,6 +130,23 @@ function merge_next(hit1, hit2) { } else { console.log("SSML field missing from one or both items; skip SSML merge"); } + // build arrays of Lambda Hooks and arguments + var lambdahooks = _.get(hit1, "lambdahooks",[]); + // if hits1 doesn't have a lambdahooks field (no previous merge), then initialize using 'l' and 'args' from hit 1 + if ( lambdahooks.length == 0 ) { + lambdahooks = [ + { + l: _.get(hit1, "l"), + args: _.get(hit1, "args",[]), + } + ]; + } + lambdahooks.push({ + l: _.get(hit2, "l"), + args: _.get(hit2, "args",[]), + }); + _.set(hit2, "lambdahooks", lambdahooks); + // all other fields inherited from item 2 console.log("Chained items merged:", hit2); return hit2; @@ -73,21 +170,39 @@ async function get_hit(req, res) { var response = await run_query(req, query_params); console.log("Query response: ", JSON.stringify(response,null,2)); var hit = _.get(response, "hits.hits[0]._source"); + + _.set(res, "kendraResultsCached", response.kendraResultsCached); + if (response.kendraResultsCached) console.log(`kendra results cached in res structure`); + _.set(req, "session.qnabotcontext.kendra", response.kendra_context); + if (response.kendra_context) console.log(`kendra context set in res session`); + + // ES fallback if KendraFAQ fails + if (!hit && _.get(req, '_settings.KENDRA_FAQ_ES_FALLBACK', true)) { + console.log('ElasticSearch Fallback'); + response = await run_query_es(req, query_params); + if (_.get(response, "hits.hits[0]._source")) { + _.set(response, "hits.hits[0]._source.answersource", "ElasticSearch Fallback"); + } + hit = _.get(response, "hits.hits[0]._source"); + } + if (hit) { res['got_hits'] = 1; // response flag, used in logging / kibana } else { console.log("No hits from query - searching instead for: " + no_hits_question); query_params['question'] = no_hits_question; res['got_hits'] = 0; // response flag, used in logging / kibana + response = await run_query(req, query_params); hit = _.get(response, "hits.hits[0]._source"); } // Do we have a hit? if (hit) { - // set res topic from document before running handlebars, so that handlebars cann access or overwrite it. + // set res topic from document before running handlebars, so that handlebars can access or overwrite it. _.set(res, "session.topic", _.get(hit, "t")); // run handlebars template processing hit = await handlebars(req, res, hit); + // encrypt conditionalChaining rule, if set const conditionalChaining = _.get(hit, "conditionalChaining"); if (conditionalChaining) { @@ -122,16 +237,31 @@ async function evaluateConditionalChaining(req, res, hit, conditionalChaining) { // Chaining rule is a Lambda function var lambdaName = conditionalChaining.split("::")[1] ; console.log("Calling Lambda:", lambdaName); + var event={req:req, res:res}; var lambda= new aws.Lambda(); var lambdares=await lambda.invoke({ FunctionName:lambdaName, InvocationType:"RequestResponse", - Payload:JSON.stringify({ - req:req, - res:res - }) + Payload:JSON.stringify(event) }).promise(); - next_q=lambdares.Payload; + console.log("Chaining Rule Lambda response: ", lambdares); + var payload=lambdares.Payload; + try { + payload = JSON.parse(payload); + } catch (e) { + // response is not JSON + } + if (_.get(payload,"req") && _.get(payload,"res")) { + console.log("Chaining Rules Lambda returned possibly modified session event in response."); + req = _.get(payload,"req") ; + res = _.get(payload,"res") ; + next_q = _.get(payload,"req.question"); + } + else { + console.log("Chaining Rules Lambda did not return session event in response."); + console.log("assume response is a simple string containing next_q value"); + next_q = payload ; + } } else { // create chaining rule safeEval context, aligned with Handlebars context const SessionAttributes = (arg) => _.get(SessionAttributes, arg, undefined); @@ -170,10 +300,11 @@ async function evaluateConditionalChaining(req, res, hit, conditionalChaining) { elicitResponse.chainingConfig = chaining_configuration; } _.set(res.session,'qnabotcontext.elicitResponse',elicitResponse); - return (merge_next(hit, hit2)); + var mergedhit = merge_next(hit, hit2); + return [req, res, mergedhit] ; } else { console.log("WARNING: No documents found for evaluated chaining rule:", next_q); - return hit; + return [req, res, hit]; } } @@ -191,22 +322,31 @@ module.exports = async function (req, res) { const elicitResponseChainingConfig = _.get(res, "session.qnabotcontext.elicitResponse.chainingConfig", undefined); const elicitResponseProgress = _.get(res, "session.qnabotcontext.elicitResponse.progress", undefined); let hit = undefined; - if (elicitResponseChainingConfig && (elicitResponseProgress === 'Fulfilled') || elicitResponseProgress === 'ReadyForFulfillment') { + if (elicitResponseChainingConfig && (elicitResponseProgress === 'Fulfilled' || elicitResponseProgress === 'ReadyForFulfillment' || elicitResponseProgress === 'Failed' )) { // elicitResponse is finishing up as the LexBot has fulfilled its intent. // we use a fakeHit with either the Bot's message or an empty string. let fakeHit = {}; fakeHit.a = res.message ? res.message : ""; - hit = await evaluateConditionalChaining(req, res, fakeHit, elicitResponseChainingConfig); + [req, res, hit] = await evaluateConditionalChaining(req, res, fakeHit, elicitResponseChainingConfig); } else { // elicitResponse is not involved. obtain the next question to serve up to the user. hit = await get_hit(req, res); + } + if (hit) { // found a document in elastic search. - if (_.get(hit, "conditionalChaining") && _.get(hit, "elicitResponse.responsebot_hook", "") === "" ) { + var c=0; + while (_.get(hit, "conditionalChaining") && _.get(hit, "elicitResponse.responsebot_hook", "") === "" ) { + c++; // ElicitResonse is not involved and this document has conditionalChaining defined. Process the // conditionalChaining in this case. - hit = await evaluateConditionalChaining(req, res, hit, hit.conditionalChaining); + [req, res, hit] = await evaluateConditionalChaining(req, res, hit, hit.conditionalChaining); + console.log("Chained doc count: ", c); + if (c >= 10) { + console.log("Reached Max limit of 10 chained documents (safeguard to prevent infinite loops).") ; + break ; + } } // translate response var usrLang = 'en'; @@ -224,7 +364,8 @@ module.exports = async function (req, res) { var msg = "User Input: \"" + req.question + "\""; if (usrLang != 'en') { msg = "User Input: \"" + _.get(req,"_event.origQuestion","notdefined") + "\", Translated to: \"" + req.question + "\""; - } + } + msg += ", Source: " + _.get(hit, "answersource", "unknown"); var debug_msg = { a: "[" + msg + "] ", alt: { @@ -238,6 +379,16 @@ module.exports = async function (req, res) { res.type = "PlainText" res.message = res.result.a res.plainMessage = res.result.a + + // Add answerSource for query hits + var ansSource = _.get(hit, "answersource", "unknown") + if (ansSource==="Kendra FAQ") { // kendra fallback sets answerSource directly + res.answerSource = "KENDRA" + } else if (ansSource==="ElasticSearch" || ansSource==="ElasticSearch Fallback") { + res.answerSource = "ELASTICSEARCH" + } else { + res.answerSource = ansSource + } // Add alt messages to appContext session attribute JSON value (for lex-web-ui) var tmp @@ -267,9 +418,9 @@ module.exports = async function (req, res) { } - var navigationJson = _.get(res, "session.navigation", false) - var previousQid = _.get(res, "session.previous.qid", false) - var previousArray = _.get(res, "session.navigation.previous", []) + var navigationJson = _.get(res, "session.qnabotcontext.navigation", false) + var previousQid = _.get(res, "session.qnabotcontext.previous.qid", false) + var previousArray = _.get(res, "session.qnabotcontext.navigation.previous", []) if ( previousQid != _.get(res.result, "qid") && @@ -289,27 +440,26 @@ module.exports = async function (req, res) { if ("next" in res.result) { hasParent = false } - res.session.previous = { + _.set(res,"session.qnabotcontext.previous", { qid: _.get(res.result, "qid"), a: _.get(res.result, "a"), alt: _.get(res.result, "alt", {}), q: req.question - } - res.session.navigation = { - next: _.get(res.result, - "next", - _.get(res, "session.navigation.next", "") - ), + }) ; + _.set(res,"session.qnabotcontext.navigation", { + next: _.get(res.result, "next", _.get(res, "session.qnabotcontext.navigation.next", "")), previous: previousArray, hasParent: hasParent - } + }) ; } else { - res.type = "PlainText" + res.type = "PlainText"; res.message = _.get(req, '_settings.EMPTYMESSAGE', 'You stumped me!'); } // add session attributes for qid and no_hits - useful for Amazon Connect integration res.session.qnabot_qid = _.get(res.result, "qid", "") ; res.session.qnabot_gotanswer = (res['got_hits'] > 0) ? true : false ; - console.log("RESULT", JSON.stringify(req), JSON.stringify(res)) + var event = {req, res} ; + console.log("RESULT", JSON.stringify(event)); + return event ; }; diff --git a/lambda/proxy-es/package-lock.json b/lambda/proxy-es/package-lock.json index 37006da42..c02b90d9a 100644 --- a/lambda/proxy-es/package-lock.json +++ b/lambda/proxy-es/package-lock.json @@ -4,10 +4,32 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } }, "archiver": { "version": "3.1.1", @@ -66,6 +88,25 @@ } } }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array.prototype.map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", + "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.4" + } + }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -122,6 +163,11 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, + "binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" + }, "bl": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", @@ -154,6 +200,19 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + }, "buffer": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", @@ -168,6 +227,11 @@ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, "cfn-lambda": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cfn-lambda/-/cfn-lambda-4.0.0.tgz", @@ -181,6 +245,89 @@ "underscore": "^1.8.3" } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chokidar": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.3.0" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -249,6 +396,29 @@ "ms": "2.0.0" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -257,11 +427,100 @@ "once": "^1.4.0" } }, + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==" + }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, "events": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "requires": { + "is-buffer": "~2.0.3" + } + }, "follow-redirects": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", @@ -280,6 +539,22 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -293,11 +568,24 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "requires": { + "is-glob": "^4.0.1" + } + }, "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" + }, "handlebars": { "version": "4.7.6", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", @@ -310,6 +598,29 @@ "wordwrap": "^1.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", @@ -337,16 +648,131 @@ "lodash.toarray": "^3.0.0" } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" + }, + "is-callable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==" + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==" + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" + }, + "is-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==" + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==" + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "iterate-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", + "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==" + }, + "iterate-value": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", + "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", + "requires": { + "es-get-iterator": "^1.0.2", + "iterate-iterator": "^1.0.1" + } + }, "jmespath": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=" }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsonschema": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.6.tgz", @@ -376,6 +802,14 @@ } } }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", @@ -451,12 +885,12 @@ "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" }, - "markdown": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/markdown/-/markdown-0.5.0.tgz", - "integrity": "sha1-KCBbVlqK51kt4gdGPWY33BgnIrI=", + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", "requires": { - "nopt": "~2.1.1" + "chalk": "^2.4.2" } }, "minimatch": { @@ -472,6 +906,53 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, + "mocha": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.0.tgz", + "integrity": "sha512-sI0gaI1I/jPVu3KFpnveWGadfe3JNBAENqgTUPgLZAUppu725zS2mrVztzAgIR8DUscuS4doEBTx9LATC+HSeA==", + "requires": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.3.1", + "debug": "3.2.6", + "diff": "4.0.2", + "escape-string-regexp": "1.0.5", + "find-up": "4.1.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", + "minimatch": "3.0.4", + "ms": "2.1.2", + "object.assign": "4.1.0", + "promise.allsettled": "1.0.2", + "serialize-javascript": "4.0.0", + "strip-json-comments": "3.0.1", + "supports-color": "7.1.0", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.0.0", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.1" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -487,19 +968,32 @@ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==" }, - "nopt": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", - "integrity": "sha1-bMzZd7gBMqB3MdbozljCyDA8+a8=", - "requires": { - "abbrev": "1" - } - }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -508,16 +1002,59 @@ "wrappy": "1" } }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "promise.allsettled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", + "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", + "requires": { + "array.prototype.map": "^1.0.1", + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "iterate-value": "^1.0.0" + } + }, "punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", @@ -528,6 +1065,14 @@ "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -538,6 +1083,24 @@ "util-deprecate": "^1.0.1" } }, + "readdirp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "requires": { + "picomatch": "^2.0.7" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -558,6 +1121,19 @@ "resolved": "https://registry.npmjs.org/scmp/-/scmp-2.0.0.tgz", "integrity": "sha1-JHEQ7yLM+JexOj8KvdtSeCOTzWo=" }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, "simple-encryptor": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/simple-encryptor/-/simple-encryptor-3.0.0.tgz", @@ -571,6 +1147,38 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -579,6 +1187,34 @@ "safe-buffer": "~5.1.0" } }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==" + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "requires": { + "has-flag": "^4.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + } + } + }, "tar-stream": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.2.tgz", @@ -591,6 +1227,14 @@ "readable-stream": "^3.1.1" } }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, "uglify-js": { "version": "3.9.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.4.tgz", @@ -624,11 +1268,72 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "requires": { + "string-width": "^1.0.2 || 2" + } + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" }, + "workerpool": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", + "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==" + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -648,6 +1353,186 @@ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.1.tgz", + "integrity": "sha512-qZV14lK9MWsGCmcr7u5oXGH0dbGqZAIxTDrWXZDo5zUr6b6iUmelNKO6x6R1dQT24AH3LgRxJpr8meWy2unolA==", + "requires": { + "camelcase": "^5.3.1", + "decamelize": "^1.2.0", + "flat": "^4.1.0", + "is-plain-obj": "^1.1.0", + "yargs": "^14.2.3" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "yargs": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", + "requires": { + "cliui": "^5.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^15.0.1" + } + }, + "yargs-parser": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "zip-stream": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.3.tgz", diff --git a/lambda/proxy-es/package.json b/lambda/proxy-es/package.json index 18a9d8d97..1cbe8eb55 100644 --- a/lambda/proxy-es/package.json +++ b/lambda/proxy-es/package.json @@ -3,12 +3,6 @@ "version": "1.0.0", "description": "", "main": "index.js", - "directories": { - "test": "test" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, "author": "", "license": "ISC", "dependencies": { @@ -17,10 +11,13 @@ "bluebird": "^3.5.1", "bodybuilder": "^2.2.7", "cfn-lambda": "^4.0.0", - "markdown": "^0.5.0", "handlebars": "^4.7.2", + "mocha": "^8.0.1", "safe-eval": "^0.4.1", "simple-encryptor": "^3.0.0", "intercept-stdout": "^0.1.2" + }, + "scripts": { + "test": "mocha --timeout 100000" } } diff --git a/lambda/proxy-es/test/kendrafaq_nofallback/req.json b/lambda/proxy-es/test/kendrafaq_nofallback/req.json new file mode 100644 index 000000000..3540a52f8 --- /dev/null +++ b/lambda/proxy-es/test/kendrafaq_nofallback/req.json @@ -0,0 +1,98 @@ +{ + "_event": { + "messageVersion": "1.0", + "invocationSource": "FulfillmentCodeHook", + "userId": "us-east-1:6da887b1-e551-49a3-b3e4-cdd699d6d712", + "sessionAttributes": {}, + "requestAttributes": null, + "bot": { + "name": "QNA_dev_dev_dev_master_seven_BotLiDxq", + "alias": "live", + "version": "1" + }, + "outputDialogMode": "Text", + "currentIntent": { + "name": "fulfilment_IntentHSoCsGkoSC", + "slots": { + "slot": "what are the main goals of an economy" + }, + "slotDetails": { + "slot": { + "resolutions": [], + "originalValue": "what are the main goals of an economy" + } + }, + "confirmationStatus": "None" + }, + "inputTranscript": "what are the main goals of an economy?", + "recentIntentSummaryView": null, + "sentimentResponse": null, + "kendraResponse": null, + "origQuestion": "what are the main goals of an economy?" + }, + "_settings": { + "ENABLE_DEBUG_RESPONSES": true, + "ES_USE_KEYWORD_FILTERS": true, + "ES_KEYWORD_SYNTAX_TYPES": "NOUN,PROPN,VERB,INTJ", + "ES_SYNTAX_CONFIDENCE_LIMIT": ".20", + "ES_MINIMUM_SHOULD_MATCH": "2<75%", + "ES_NO_HITS_QUESTION": "no_hits", + "ES_USE_FUZZY_MATCH": false, + "ES_PHRASE_BOOST": "4", + "ES_SCORE_ANSWER_FIELD": false, + "ENABLE_SENTIMENT_SUPPORT": true, + "ENABLE_MULTI_LANGUAGE_SUPPORT": true, + "MINIMUM_CONFIDENCE_SCORE": 0.6, + "ALT_SEARCH_KENDRA_INDEXES": "", + "KENDRA_FAQ_INDEX": "4cb810f8-4326-43f2-ba22-aaccd447a1e2", + "KENDRAFAQ_CONFIG_MAX_RETRIES": 8, + "KENDRAFAQ_CONFIG_RETRY_DELAY": 600, + "KENDRA_FAQ_ES_FALLBACK": true, + "ERRORMESSAGE": "Unfortunately I encountered an error when searching for your answer. Please ask me again later.", + "EMPTYMESSAGE": "You stumped me! Sadly I don't know how to answer your question.", + "DEFAULT_ALEXA_LAUNCH_MESSAGE": "Hello, Please ask a question", + "DEFAULT_ALEXA_STOP_MESSAGE": "Goodbye", + "SMS_HINT_REMINDER_ENABLE": true, + "SMS_HINT_REMINDER": " (Feedback? Reply THUMBS UP or THUMBS DOWN. Ask HELP ME at any time)", + "SMS_HINT_REMINDER_INTERVAL_HRS": "24", + "IDENTITY_PROVIDER_JWKS_URLS": [], + "ENFORCE_VERIFIED_IDENTITY": false, + "NO_VERIFIED_IDENTITY_QUESTION": "no_verified_identity", + "ELICIT_RESPONSE_MAX_RETRIES": 3, + "ELICIT_RESPONSE_RETRY_MESSAGE": "Please try again?", + "ELICIT_RESPONSE_BOT_FAILURE_MESSAGE": "Your response was not understood. Please start again.", + "ELICIT_RESPONSE_DEFAULT_MSG": "Ok. ", + "ENABLE_REDACTING": false, + "REDACTING_REGEX": "\\b\\d{4}\\b(?![-])|\\b\\d{9}\\b|\\b\\d{3}-\\d{2}-\\d{4}\\b", + "DEFAULT_USER_POOL_JWKS_URL": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_Z8rcwzAak/.well-known/jwks.json" + }, + "_type": "LEX", + "_userId": "us-east-1:6da887b1-e551-49a3-b3e4-cdd699d6d712", + "question": "what are the main goals of an economy?", + "session": { + "userDetectedLocale": "en", + "userDetectedLocaleConfidence": 0.9996602535247803, + "userLocale": "en" + }, + "_preferredResponseType": "PlainText", + "_clientType": "LEX.LexWebUI.Text", + "sentiment": "NEUTRAL", + "_userInfo": { + "UserId": "us-east-1:6da887b1-e551-49a3-b3e4-cdd699d6d712", + "InteractionCount": 0, + "isVerifiedIdentity": "false", + "TimeSinceLastInteraction": 1596430836.5 + }, + "_info": { + "es": { + "address": "search-qna-dev-elasti-aqgbf5wtxcp9-fap4rgyhrzxt5utdgmh4vtjew4.us-east-1.es.amazonaws.com", + "index": "qna-dev-dev-dev-master-7", + "type": "qna", + "service": { + "qid": "QNA-dev-dev-dev-master-7-ESQidLambda-1VNOB0ZUK7LYG", + "proxy": "QNA-dev-dev-dev-master-7-ESProxyLambda-1ODSNUWEBL2E9" + } + } + } +} + diff --git a/lambda/proxy-es/test/kendrafaq_nofallback/res.json b/lambda/proxy-es/test/kendrafaq_nofallback/res.json new file mode 100644 index 000000000..8a0e172a9 --- /dev/null +++ b/lambda/proxy-es/test/kendrafaq_nofallback/res.json @@ -0,0 +1,24 @@ +{ + "type": "PlainText", + "message": "", + "session": { + "userDetectedLocale": "en", + "userDetectedLocaleConfidence": 0.9996602535247803, + "userLocale": "en" + }, + "card": { + "send": false, + "title": "", + "text": "", + "url": "" + }, + "_userInfo": { + "UserId": "us-east-1:6da887b1-e551-49a3-b3e4-cdd699d6d712", + "InteractionCount": 1, + "isVerifiedIdentity": "false", + "TimeSinceLastInteraction": 1596430836.5, + "FirstSeen": "Mon Aug 03 2020 17:00:36 GMT+0000 (Coordinated Universal Time)", + "LastSeen": "Mon Aug 03 2020 17:00:36 GMT+0000 (Coordinated Universal Time)" + }, + "got_hits": 1 +} diff --git a/lambda/proxy-es/test/rate_tester.js b/lambda/proxy-es/test/rate_tester.js new file mode 100644 index 000000000..9e4920669 --- /dev/null +++ b/lambda/proxy-es/test/rate_tester.js @@ -0,0 +1,101 @@ +// rate tester for kendra throttle + +const sleep = require('util').promisify(setTimeout) +const AWS = require('aws-sdk'); +AWS.config.update({ + maxRetries: 8, // default 3 + retryDelayOptions: { + base: 600, // default 100 + }, +}); + + + +async function query(kendraClient, kendra_params, params, resArray) { + var j, count_throttles=0, count_sleeps=0, count_successes=0; + var start = new Date().getTime(); + + for (j=0; j { + it('rate_tester', async function() { + await rate_tester(); + }); + +}); + + + + + + diff --git a/lambda/testall/lib/lex.js b/lambda/testall/lib/lex.js index da38caa31..3e2012bd2 100644 --- a/lambda/testall/lib/lex.js +++ b/lambda/testall/lib/lex.js @@ -24,8 +24,9 @@ function processWithLex(data, filter) { inputText: question }).promise(); let res_qid; - if (resp.sessionAttributes.previous) { - let previous = JSON.parse(resp.sessionAttributes.previous); + if (resp.sessionAttributes.qnabotcontext) { + let qnabotcontext = JSON.parse(resp.sessionAttributes.qnabotcontext); + let previous = qnabotcontext.previous; res_qid = previous.qid; } if (res_qid === undefined) { diff --git a/lambda/testall/package-lock.json b/lambda/testall/package-lock.json index 63f20ce1b..2bd9cf321 100644 --- a/lambda/testall/package-lock.json +++ b/lambda/testall/package-lock.json @@ -18,9 +18,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash._arraycopy": { "version": "3.0.0", diff --git a/lambda/testall/package.json b/lambda/testall/package.json index da35bcdbb..5263078d5 100644 --- a/lambda/testall/package.json +++ b/lambda/testall/package.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "bluebird": "^3.5.1", - "lodash": "^4.17.4", + "lodash": "^4.17.19", "intercept-stdout": "^0.1.2" } } diff --git a/package-lock.json b/package-lock.json index afa9e40fd..c463831ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "aws-ai-qna-bot", - "version": "4.1.0", + "version": "4.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2283,8 +2283,8 @@ "integrity": "sha1-8YL0DRd1fZeKE5pMnKQMTA5EhgM=" }, "aws-lex-web-ui": { - "version": "git+https://github.com/aws-samples/aws-lex-web-ui.git#70befe88bcebfc733ee05483dba474a73f30cded", - "from": "git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.17.0", + "version": "git+https://github.com/aws-samples/aws-lex-web-ui.git#2ce27356d7edec5e9bc92e94fc7583857555e95a", + "from": "git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.17.2", "requires": { "amazon-cognito-auth-js": "^1.2.4", "core-js": "^3.6.5", @@ -2299,9 +2299,9 @@ "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==" }, "regenerator-runtime": { - "version": "0.13.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==" + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" } } }, diff --git a/package.json b/package.json index 58e8e6dd4..38ccfc7f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-ai-qna-bot", - "version": "4.1.0", + "version": "4.2.0", "engines": { "node": ">=8.9.4", "npm": ">=5.0.0" @@ -46,7 +46,7 @@ "ask-cli": "^1.7.23", "async-mutex": "^0.1.3", "autosize": "^3.0.21", - "aws-lex-web-ui": "git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.17.0", + "aws-lex-web-ui": "git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.17.2", "aws-sdk": "^2.702.0", "aws4": "^1.7.0", "axios": "^0.19.0", diff --git a/templates/examples/examples/examples/QnaUtility.json b/templates/examples/examples/examples/QnaUtility.json index ca7353b4e..00199e920 100644 --- a/templates/examples/examples/examples/QnaUtility.json +++ b/templates/examples/examples/examples/QnaUtility.json @@ -67,7 +67,18 @@ "help me", "need help" ] - } - + }, + { + "qid": "Repeat", + "a": "{{!-- The 'repeat' magic is in the Document Chaining Rule in the Advanced section --}}", + "conditionalChaining": "(SessionAttributes('qnabotcontext.previous.q')) ? SessionAttributes('qnabotcontext.previous.q') : 'help'", + "type": "qna", + "q": [ + "Repeat", + "Can you repeat that", + "Can you please say that again", + "Please repeat that" + ] + } ] } \ No newline at end of file diff --git a/templates/examples/examples/examples/QnaUtility.txt b/templates/examples/examples/examples/QnaUtility.txt index 1ce786b64..9fe899319 100644 --- a/templates/examples/examples/examples/QnaUtility.txt +++ b/templates/examples/examples/examples/QnaUtility.txt @@ -1 +1 @@ -Imports configurable functionality enhancements. 1) A configurable no_hits QID. 2) A configurable no_verified_identity QID. 2) A configurable help QID. 3) A configurable feedback flow that is attached to the thumbs up/down buttons in the UI. \ No newline at end of file +Basic utility QIDS every bot should support: 1) no_hits 2) no_verified_identity 3) Help 4) Repeat 5) Feedback - Thumbs up and Down. \ No newline at end of file diff --git a/templates/examples/examples/js/Quiz.js b/templates/examples/examples/js/Quiz.js index 547d84921..bc253b698 100644 --- a/templates/examples/examples/js/Quiz.js +++ b/templates/examples/examples/js/Quiz.js @@ -37,7 +37,7 @@ exports.handler=async function(event,context,callback){ questionCount:0, correctAnswerCount:0, next:event.res.result.args[0], - originalDocumentQid:_.get(event,"res.session.previous.qid","") + originalDocumentQid:_.get(event,"res.session.qnabotcontext.previous.qid","") } } console.log(JSON.stringify(quizBot,null,2)) diff --git a/templates/examples/examples/package-lock.json b/templates/examples/examples/package-lock.json index b798712ab..a2ddca0ed 100644 --- a/templates/examples/examples/package-lock.json +++ b/templates/examples/examples/package-lock.json @@ -33,9 +33,9 @@ } }, "lodash": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.13.tgz", - "integrity": "sha512-vm3/XWXfWtRua0FkUyEHBZy8kCPjErNBT9fJx8Zvs+U6zjqPbTUOpkaoum3O5uiA8sm+yNMHXfYkTUHFoMxFNA==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "minimist": { "version": "1.2.5", diff --git a/templates/examples/examples/package.json b/templates/examples/examples/package.json index 9ae97447f..014199e2c 100644 --- a/templates/examples/examples/package.json +++ b/templates/examples/examples/package.json @@ -12,6 +12,6 @@ "bluebird": "^3.5.1", "cfn-response": "^1.0.1", "handlebars": "^4.7.6", - "lodash": "^4.17.13" + "lodash": "^4.17.19" } } diff --git a/templates/examples/examples/py/Feedback.py b/templates/examples/examples/py/Feedback.py index f7542e6fd..7fa62c8be 100644 --- a/templates/examples/examples/py/Feedback.py +++ b/templates/examples/examples/py/Feedback.py @@ -25,26 +25,27 @@ def handler(event, context): else: print("no kendra information present in session attribute qnabotcontext") - try: #get the Question ID (qid) of the previous document that was returned to the web client - previous = event["req"]["session"]["previous"] + previous = event["req"]["session"]["qnabotcontext"]["previous"] previousQid = previous["qid"] previousQuestion = previous["q"] previousAnswer = previous["a"] previousAlt = previous["alt"] feedbackArg = event["res"]["result"]["args"][0] print(feedbackArg) + # - Check feedbackArg from the UI payload. Parse for "thumbs_down_arg" feedback. Based on user action, sendFeedback through SNS, and log in Firehose. if feedbackArg == "incorrect": sendFeedbackNotification(previousQid, previousAnswer, previousQuestion, previousAlt, feedbackArg) - if (kendraIndexId is not None) and (kendraResponsibleQid == previousQid): + if (kendraIndexId is not None) and (kendraResponsibleQid==previousQid or kendraResponsibleQid=='KendraFAQ'): print("submitting NOT_RELEVANT to Kendra Feedback") submitFeedbackForKendra(kendraIndexId, kendraQueryId, kendraResultId, "NOT_RELEVANT") logFeedback(previousQid,previousAnswer,previousQuestion, previousAlt, feedbackArg) print("Negative feedback logged, and SNS notification sent") + else: - if (kendraIndexId is not None) and (kendraResponsibleQid == previousQid): + if (kendraIndexId is not None) and (kendraResponsibleQid==previousQid or kendraResponsibleQid=='KendraFAQ'): print("submitting RELEVANT to Kendra Feedback") submitFeedbackForKendra(kendraIndexId, kendraQueryId, kendraResultId, "RELEVANT") logFeedback(previousQid, previousAnswer, previousQuestion, previousAlt, feedbackArg) diff --git a/templates/examples/examples/py/Next.py b/templates/examples/examples/py/Next.py index b5675eca0..021644e74 100644 --- a/templates/examples/examples/py/Next.py +++ b/templates/examples/examples/py/Next.py @@ -13,20 +13,14 @@ def handler(event, context): try: #Because "sub documents", like a sofa document that is connected to a room document, does not have a next, the in built query lambda attempts to figure out a parent document and will give the necessary information to perform room iteration - #for Lex - if "sessionAttributes" in event["req"]["_event"]: - previousToJson = json.loads(event["req"]["_event"]["sessionAttributes"]["previous"]) - navigationToJson = json.loads(event["req"]["_event"]["sessionAttributes"]["navigation"]) - #for Alexa - else: - previousToJson = json.loads(event["req"]["_event"]["session"]["attributes"]["previous"]) - navigationToJson = json.loads(event["req"]["_event"]["session"]["attributes"]["navigation"]) + previousToJson = event["req"]["session"]["qnabotcontext"]["previous"] + navigationToJson = event["req"]["session"]["qnabotcontext"]["navigation"] qid = previousToJson["qid"] nextDoc = navigationToJson["next"] except KeyError as k: # hit this case if user calls next on a client with no other answered phrases - event["res"]["session"]["previous"]={} - event["res"]["session"]["navigation"]={} + event["res"]["session"]["qnabotcontext"]["previous"]={} + event["res"]["session"]["qnabotcontext"]["navigation"]={} return event #for now we only go to the first document in list of next documents, change later when we add functionality for branching and converging paths @@ -62,11 +56,9 @@ def handler(event, context): else: #if the response has no answer we must have hit the end of the guided navigation for this segment #if unable to find anything, set the previous attribute back to the document qid that was previously returned,since we don't want this document to be in history - event["res"]["session"]["previous"]={"qid":qid,"a":previousToJson["a"],"q":previousToJson["q"]} - event["res"]["session"]["navigation"]={"next":navigationToJson["next"],"previous":navigationToJson["previous"],"hasParent":navigationToJson["hasParent"]} - #uncomment line below if you want to see the final JSON before it is returned to the client - # print(json.dumps(event)) - + event["res"]["session"]["qnabotcontext"]["previous"]={"qid":qid,"a":previousToJson["a"],"q":previousToJson["q"]} + event["res"]["session"]["qnabotcontext"]["navigation"]={"next":navigationToJson["next"],"previous":navigationToJson["previous"],"hasParent":navigationToJson["hasParent"]} + print(json.dumps(event)) return event @@ -102,15 +94,9 @@ def mapToArn(name,stack): #update the event with the information if there is a Lambda hook def updateLambdaHook(event,hookEvent, response): - #for Lex - if "sessionAttributes" in event["req"]["_event"]: - previousToJson = json.loads(event["req"]["_event"]["sessionAttributes"]["previous"]) - navigationToJson = json.loads(event["req"]["_event"]["sessionAttributes"]["navigation"]) - #for Alexa - else: - previousToJson = json.loads(event["req"]["_event"]["session"]["attributes"]["previous"]) - navigationToJson = json.loads(event["req"]["_event"]["session"]["attributes"]["navigation"]) - #only append to navigation list if top level document or not returning the same document from before(if a document points to itself as the next document) + previousToJson = event["req"]["session"]["qnabotcontext"]["previous"] + navigationToJson = event["req"]["session"]["qnabotcontext"]["navigation"] + #only append to navigation list if top level document or not returning the same document from before(if a document points to itself as the next document) tempList= navigationToJson["previous"] if not navigationToJson["hasParent"]: if(len(tempList) == 0): @@ -124,8 +110,8 @@ def updateLambdaHook(event,hookEvent, response): tempList.pop(0) if "session" not in hookEvent["res"]: hookEvent["res"]["session"] = {} - hookEvent["res"]["session"]["previous"] ={"qid":response["qid"],"a":previousToJson["a"],"alt":previousToJson.get("alt",{}),"q":event["req"]["question"]} - hookEvent["res"]["session"]["navigation"]={"next":response.get("next",""),"previous":tempList,"hasParent":False} + hookEvent["res"]["session"]["qnabotcontext"]["previous"] ={"qid":response["qid"],"a":previousToJson["a"],"alt":previousToJson.get("alt",{}),"q":event["req"]["question"]} + hookEvent["res"]["session"]["qnabotcontext"]["navigation"]={"next":response.get("next",""),"previous":tempList,"hasParent":False} return hookEvent #update the event with the information from the new Query @@ -160,15 +146,9 @@ def updateResult(event, response): event["res"]["card"]["buttons"] = card["buttons"] if 't' in response: event["res"]["session"]["topic"] = response["t"] - - #for Lex - if "sessionAttributes" in event["req"]["_event"]: - previousToJson = json.loads(event["req"]["_event"]["sessionAttributes"]["previous"]) - navigationToJson = json.loads(event["req"]["_event"]["sessionAttributes"]["navigation"]) - #for Alexa - else: - previousToJson = json.loads(event["req"]["_event"]["session"]["attributes"]["previous"]) - navigationToJson = json.loads(event["req"]["_event"]["session"]["attributes"]["navigation"]) + + previousToJson = event["req"]["session"]["qnabotcontext"]["previous"] + navigationToJson = event["req"]["session"]["qnabotcontext"]["navigation"] tempList= navigationToJson["previous"] #only append to navigation list if top level document or not returning the same document from before(if a document points to itself as the next document) if not navigationToJson["hasParent"]: @@ -181,7 +161,7 @@ def updateResult(event, response): if len(tempList) > 10: #setting limit to 10 elements in previous stack since ,since lex has a max header size and we want to save that for other functions, same max size is set in the query lambda tempList.pop(0) - event["res"]["session"]["previous"] ={"qid":response["qid"],"a":previousToJson["a"],"alt":previousToJson.get("alt",{}),"q":event["req"]["question"]} - event["res"]["session"]["navigation"]={"next":response.get("next",""),"previous":tempList,"hasParent":False} + event["res"]["session"]["qnabotcontext"]["previous"] ={"qid":response["qid"],"a":previousToJson["a"],"alt":previousToJson.get("alt",{}),"q":event["req"]["question"]} + event["res"]["session"]["qnabotcontext"]["navigation"]={"next":response.get("next",""),"previous":tempList,"hasParent":False} return event diff --git a/templates/examples/examples/py/Previous.py b/templates/examples/examples/py/Previous.py index ace6e5aff..5ab315882 100644 --- a/templates/examples/examples/py/Previous.py +++ b/templates/examples/examples/py/Previous.py @@ -8,18 +8,12 @@ def handler(event, context): - jsondump = json.dumps(event) - print(jsondump) + print("INPUT: ",json.dumps(event)) # check we aren't calling this function before any document have been returned to the client and that try: #Because "sub documents", like a sofa document that is connected to a room document, does not have a next, the in built query lambda attempts to figure out a parent document and will give the necessary information to perform room iteration - #for Lex - if "sessionAttributes" in event["req"]["_event"]: - navigationToJson = json.loads(event["req"]["_event"]["sessionAttributes"]["navigation"]) - #for Alexa - else: - navigationToJson = json.loads(event["req"]["_event"]["session"]["attributes"]["navigation"]) + navigationToJson = event["req"]["session"]["qnabotcontext"]["navigation"] except KeyError as k: navigationToJson = {} qidList = navigationToJson.get("previous",[]) @@ -29,7 +23,7 @@ def handler(event, context): if len(qidList) > 0: client = boto3.client('lambda') #Invoke the prepackaged function that Queries ElasticSearch using a document qid - temp = qidList.pop() + temp = qidList[-1] resp = client.invoke( FunctionName = event["req"]["_info"]["es"]["service"]["qid"], Payload = json.dumps({'qid':temp,'type':"qid"}), @@ -64,12 +58,10 @@ def handler(event, context): event = updateResult(event,response) # modify the event to make the previous question the redirected question that was just asked instead of "Next Question" else: - event["res"]["session"]["previous"] ={"qid":qidList,"a":navigationToJson["a"],"q":navigationToJson["q"]} - event["res"]["session"]["navigation"]={"next":navigationToJson["next"],"previous":[],"hasParent":navigationToJson["hasParent"]} - - #uncomment line below if you want to see the final JSON before it is returned to the client - # print(json.dumps(event)) + event["res"]["session"]["qnabotcontext"]["previous"] ={"qid":qidList,"a":navigationToJson["a"],"q":navigationToJson["q"]} + event["res"]["session"]["qnabotcontext"]["navigation"]={"next":navigationToJson["next"],"previous":[],"hasParent":navigationToJson["hasParent"]} + print("OUTPUT: ",json.dumps(event)) return event #maps a shortname to the full name via CF Output stack value @@ -89,19 +81,14 @@ def mapToArn(name,stack): #update the event with the information if there is a Lambda hook def updateLambdaHook(event,hookEvent, response): - #for Lex - if "sessionAttributes" in event["req"]["_event"]: - navigationToJson = json.loads(event["req"]["_event"]["sessionAttributes"]["navigation"]) - #for Alexa - else: - navigationToJson = json.loads(event["req"]["_event"]["session"]["attributes"]["navigation"]) + navigationToJson = event["req"]["session"]["qnabotcontext"]["navigation"] tempList= navigationToJson["previous"] #shift to remove previous function name from list tempList.pop() if "session" not in hookEvent["res"]: hookEvent["res"]["session"] = {} - hookEvent["res"]["session"]["previous"] ={"qid":response["qid"],"a":response["a"],"alt":response.get("alt",{}),"q":event["req"]["question"]} - hookEvent["res"]["session"]["navigation"]={"next":response["next"],"previous":tempList,"hasParent":navigationToJson["hasParent"]} + hookEvent["res"]["session"]["qnabotcontext"]["previous"] ={"qid":response["qid"],"a":response["a"],"alt":response.get("alt",{}),"q":event["req"]["question"]} + hookEvent["res"]["session"]["qnabotcontext"]["navigation"]={"next":response["next"],"previous":tempList,"hasParent":navigationToJson["hasParent"]} return hookEvent @@ -135,17 +122,11 @@ def updateResult(event, response): event["res"]["card"]["buttons"] = card["buttons"] if 't' in response: event["res"]["session"]["topic"] = response["t"] - #for Lex - if "sessionAttributes" in event["req"]["_event"]: - navigationToJson = json.loads(event["req"]["_event"]["sessionAttributes"]["navigation"]) - #for Alexa - else: - navigationToJson = json.loads(event["req"]["_event"]["session"]["attributes"]["navigation"]) + navigationToJson = event["req"]["session"]["qnabotcontext"]["navigation"] tempList= navigationToJson["previous"] #shift to remove previous function name from list tempList.pop() - event["res"]["session"]["previous"] ={"qid":response["qid"],"a":response["a"],"alt":response.get("alt",{}),"q":event["req"]["question"]} - event["res"]["session"]["navigation"]={"next":response["next"],"previous":tempList,"hasParent":navigationToJson["hasParent"]} - + event["res"]["session"]["qnabotcontext"]["previous"] ={"qid":response["qid"],"a":response["a"],"alt":response.get("alt",{}),"q":event["req"]["question"]} + event["res"]["session"]["qnabotcontext"]["navigation"]={"next":response["next"],"previous":tempList,"hasParent":navigationToJson["hasParent"]} return event diff --git a/templates/examples/extensions/js_lambda_hooks/CustomJSHook/package-lock.json b/templates/examples/extensions/js_lambda_hooks/CustomJSHook/package-lock.json index e4294bb6d..d382497f5 100644 --- a/templates/examples/extensions/js_lambda_hooks/CustomJSHook/package-lock.json +++ b/templates/examples/extensions/js_lambda_hooks/CustomJSHook/package-lock.json @@ -33,9 +33,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "minimist": { "version": "1.2.5", diff --git a/templates/examples/extensions/js_lambda_hooks/CustomJSHook/package.json b/templates/examples/extensions/js_lambda_hooks/CustomJSHook/package.json index 28c634d2c..014199e2c 100644 --- a/templates/examples/extensions/js_lambda_hooks/CustomJSHook/package.json +++ b/templates/examples/extensions/js_lambda_hooks/CustomJSHook/package.json @@ -12,6 +12,6 @@ "bluebird": "^3.5.1", "cfn-response": "^1.0.1", "handlebars": "^4.7.6", - "lodash": "^4.17.4" + "lodash": "^4.17.19" } } diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/KendraFallback.js b/templates/examples/extensions/js_lambda_hooks/KendraFallback/KendraFallback.js index f745a5ef6..2a6bb704d 100644 --- a/templates/examples/extensions/js_lambda_hooks/KendraFallback/KendraFallback.js +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/KendraFallback.js @@ -9,7 +9,7 @@ var _ = require('lodash') * */ -const AWSKendra = require('aws-sdk/clients/kendra'); +const AWS = require('aws-sdk'); let kendraIndexes = undefined; /** @@ -83,6 +83,27 @@ function mergeIntervals(intervals) { } + +/** + * Function to return the longest interval from a list of sorted intervals + * @param intervals + * @returns {*} + */ +function longestInterval(intervals) { + // test if there are at least 2 intervals + if (intervals.length == 0) { + return intervals; + } else if (intervals.length == 1) { + return intervals[0]; + } + + // sort the intervals based on their length + intervals.sort(function(a, b) {return (a[1]-a[0]) - (b[1]-b[0])}); + return intervals[0]; + +} + + /** Function that processes kendra requests and handles response. Decides whether to handle SNS * events or Lambda Hook events from QnABot. * @param event - input event passed to the Lambda Handler @@ -100,22 +121,27 @@ async function routeKendraRequest(event, context) { let promises = []; let resArray = []; let kendraClient = undefined; + // if test environment, then use mock-up of kendraClient if (event.test) { - kendraClient = require('./test/mockClient.js'); - } else if (event.test2) { - kendraClient = require('./test/mockClient2.js'); - } else if (event.test3) { - kendraClient = require('./test/mockClient3.js'); + var mockup = './test/mockClient' + event.test + '.js'; + kendraClient = require(mockup); } else { + AWS.config.update({ + maxRetries: _.get(event.req["_settings"], "KENDRAFAQ_CONFIG_MAX_RETRIES"), + retryDelayOptions: { + base: _.get(event.req["_settings"], "KENDRAFAQ_CONFIG_RETRY_DELAY") + }, + }); kendraClient = (process.env.REGION ? - new AWSKendra({apiVersion: '2019-02-03', region: process.env.REGION}) : - new AWSKendra({apiVersion: '2019-02-03'}) + new AWS.Kendra({apiVersion: '2019-02-03', region: process.env.REGION}) : + new AWS.Kendra({apiVersion: '2019-02-03'}) ); } // process query against Kendra for QnABot let indexes = event.req["_settings"]["ALT_SEARCH_KENDRA_INDEXES"] ? event.req["_settings"]["ALT_SEARCH_KENDRA_INDEXES"] : process.env.KENDRA_INDEXES + var kendraResultsCached = _.get(event.res, "kendraResultsCached"); if (indexes && indexes.length) { try { // parse JSON array of kendra indexes @@ -126,12 +152,27 @@ async function routeKendraRequest(event, context) { } } if (kendraIndexes === undefined) { - throw new Error('Undefined Kendra Index'); + throw new Error('Undefined Kendra Indexes'); } - + // This function can handle configuration with an array of kendraIndexes. // Iterate through this area and perform queries against Kendra. kendraIndexes.forEach(function (index, i) { + // if results cached from KendraFAQ, skip index by pushing Promise to resolve cached results + if (kendraResultsCached && index===kendraResultsCached.originalKendraIndexId) { + console.log(`retrieving cached kendra results`) + + promises.push(new Promise(function(resolve, reject) { + var data = kendraResultsCached + _.set(event.req, "kendraResultsCached", "cached and retrieved"); // cleans the logs + data.originalKendraIndexId = index; + console.log("Data from Kendra request:" + JSON.stringify(data,null,2)); + resArray.push(data); + resolve(data); + })); + return; + } + const params = { IndexId: index, /* required */ QueryText: event.req["_event"].inputTranscript, /* required */ @@ -146,15 +187,18 @@ async function routeKendraRequest(event, context) { // process kendra query responses and update answer content /* default message text - can be overridden using QnABot SSM Parameter Store Custom Property */ + let topAnswerMessage = "Amazon Kendra suggested answer. \n\n "; + let topAnswerMessageMd = "*Amazon Kendra suggested answer.* \n "; let answerMessage = 'While I did not find an exact answer, these search results from Amazon Kendra might be helpful. '; let answerMessageMd = '*While I did not find an exact answer, these search results from Amazon Kendra might be helpful.* \n '; let faqanswerMessage = 'Answer from Amazon Kendra FAQ.'; let faqanswerMessageMd = '*Answer from Amazon Kendra FAQ.* \n '; let markdownAnswer = ""; + let speechMessage = ""; let helpfulLinksMsg = 'Source Link'; let extractedTextMsg = 'Discovered Text'; let moreResultsMsg = 'Additional Search Results'; - let maxDocumentCount = 4; + let maxDocumentCount = 2; var seenTop = false; let foundAnswerCount = 0; @@ -180,6 +224,7 @@ async function routeKendraRequest(event, context) { element.AdditionalAttributes[0].Value.TextWithHighlightsValue.Text) { answerMessage += '\n\n ' + element.AdditionalAttributes[0].Value.TextWithHighlightsValue.Text.replace(/\r?\n|\r/g, " "); + // Emboldens the highlighted phrases returned by the Kendra response API in markdown format let answerTextMd = element.AdditionalAttributes[0].Value.TextWithHighlightsValue.Text.replace(/\r?\n|\r/g, " "); // iterates over the answer highlights in sorted order of BeginOffset, merges the overlapping intervals var sorted_highlights = mergeIntervals(element.AdditionalAttributes[0].Value.TextWithHighlightsValue.Highlights); @@ -193,8 +238,8 @@ async function routeKendraRequest(event, context) { if (elem.TopAnswer == true) { // if top answer is found, then answer is abbreviated to this phrase seenTop = true; - answerMessage = 'Amazon Kendra suggested answer. \n\n ' + highlight + '.'; - answerMessageMd = '*Amazon Kendra suggested answer.* \n '; + answerMessage = topAnswerMessage + highlight + '.'; + answerMessageMd = topAnswerMessageMd; answerTextMd = '**' + highlight + '** '; break; } else { @@ -203,6 +248,18 @@ async function routeKendraRequest(event, context) { }; answerMessageMd = answerMessageMd + '\n\n' + answerTextMd; + // Shortens the speech response to contain say the longest highlighted phrase ONLY IF top answer not found + if (seenTop == false) { + var longest_highlight = longestInterval(sorted_highlights); + let answerText = element.AdditionalAttributes[0].Value.TextWithHighlightsValue.Text.replace(/\r?\n|\r/g, " "); + // speechMessage = answerText.substring(longest_highlight.BeginOffset, longest_highlight.EndOffset) + '.'; + + var pattern = new RegExp('[^.]* '+longest_highlight+'[^.]*\.[^.]*\.') + pattern.lastIndex = 0; // must reset this property of regex object for searches + speechMessage = pattern.exec(answerText)[0] + } + + answerDocumentUris.add(element.DocumentURI); kendraQueryId = res.QueryId; // store off the QueryId to use as a session attribute for feedback kendraIndexId = res.originalKendraIndexId; // store off the Kendra IndexId to use as a session attribute for feedback @@ -235,7 +292,6 @@ async function routeKendraRequest(event, context) { kendraResultId = element.Id; // store off resultId to use as a session attribute for feedback foundAnswerCount++; - } else if (element.Type === 'DOCUMENT' && element.DocumentExcerpt.Text && element.DocumentURI) { const docInfo = {} // if topAnswer found, then do not show document excerpts @@ -252,26 +308,41 @@ async function routeKendraRequest(event, context) { let rest = docInfo.text.substr(elem.EndOffset+offset); docInfo.text = beginning + '**' + highlight + '**' + rest; }; + + if (foundAnswerCount == 0 && foundDocumentCount == 0) { + speechMessage = element.DocumentExcerpt.Text.replace(/\r?\n|\r/g, " ");; + if (sorted_highlights.length > 0) { + var highlight = speechMessage.substring(sorted_highlights[0].BeginOffset, sorted_highlights[0].EndOffset) + var pattern = new RegExp('[^.]* '+highlight+'[^.]*\.[^.]*\.') + pattern.lastIndex = 0; // must reset this property of regex object for searches + speechMessage = pattern.exec(speechMessage)[0] + } + } } // but even if topAnswer is found, show URL in markdown docInfo.uri = element.DocumentURI; helpfulDocumentsUris.add(docInfo); - foundAnswerCount++; - foundDocumentCount++; // TODO: foundDocumentCount is not used elsewhere... + // foundAnswerCount++; + foundDocumentCount++; } }); } }); // update QnABot answer content for ssml, markdown, and text - if (foundAnswerCount > 0) { + if (foundAnswerCount > 0 || foundDocumentCount > 0) { event.res.message = answerMessage; let ssmlMessage = `${answerMessage.substring(0,600).replace(/\r?\n|\r/g, " ")}`; + if (speechMessage != "") { + ssmlMessage = `${speechMessage.substring(0,600).replace(/\r?\n|\r/g, " ")}`; + } + let lastIndex = ssmlMessage.lastIndexOf('.'); if (lastIndex > 0) { ssmlMessage = ssmlMessage.substring(0,lastIndex); } ssmlMessage = ` ${ssmlMessage} `; + event.res.session.appContext.altMessages.markdown = answerMessageMd; event.res.session.appContext.altMessages.ssml = ssmlMessage; if (event.req["_event"].outputDialogMode !== 'Text') { @@ -302,14 +373,14 @@ async function routeKendraRequest(event, context) { } }); } - + _.set(event,"res.answerSource",'KENDRA'); if (kendraQueryId) { _.set(event,"res.session.qnabotcontext.kendra.kendraQueryId",kendraQueryId) ; _.set(event,"res.session.qnabotcontext.kendra.kendraIndexId",kendraIndexId) ; _.set(event,"res.session.qnabotcontext.kendra.kendraResultId",kendraResultId) ; _.set(event,"res.session.qnabotcontext.kendra.kendraResponsibleQid",event.res.result.qid) ; } - console.log("final return: " + JSON.stringify(event,null,2)); + return event; } diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/package-lock.json b/templates/examples/extensions/js_lambda_hooks/KendraFallback/package-lock.json index b79635482..749f0e459 100644 --- a/templates/examples/extensions/js_lambda_hooks/KendraFallback/package-lock.json +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/package-lock.json @@ -84,9 +84,9 @@ "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, "brace-expansion": { @@ -536,10 +536,16 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, - "is-regex": { + "is-plain-obj": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", - "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, "requires": { "has-symbols": "^1.0.1" @@ -617,12 +623,6 @@ "p-locate": "^4.1.0" } }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, "log-symbols": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", @@ -642,9 +642,9 @@ } }, "mocha": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", - "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.1.tgz", + "integrity": "sha512-p7FuGlYH8t7gaiodlFreseLxEmxTgvyG9RgPHODFPySNhwUehu8NIb0vdSt3WFckSneswZ0Un5typYcWElk7HQ==", "dev": true, "requires": { "ansi-colors": "4.1.1", @@ -663,7 +663,7 @@ "ms": "2.1.2", "object.assign": "4.1.0", "promise.allsettled": "1.0.2", - "serialize-javascript": "3.0.0", + "serialize-javascript": "4.0.0", "strip-json-comments": "3.0.1", "supports-color": "7.1.0", "which": "2.0.2", @@ -671,7 +671,7 @@ "workerpool": "6.0.0", "yargs": "13.3.2", "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "yargs-unparser": "1.6.1" } }, "ms": { @@ -784,6 +784,15 @@ "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, "readdirp": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", @@ -805,16 +814,25 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, "sax": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=" }, "serialize-javascript": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", - "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } }, "set-blocking": { "version": "2.0.0", @@ -1099,14 +1117,107 @@ } }, "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.1.tgz", + "integrity": "sha512-qZV14lK9MWsGCmcr7u5oXGH0dbGqZAIxTDrWXZDo5zUr6b6iUmelNKO6x6R1dQT24AH3LgRxJpr8meWy2unolA==", "dev": true, "requires": { + "camelcase": "^5.3.1", + "decamelize": "^1.2.0", "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" + "is-plain-obj": "^1.1.0", + "yargs": "^14.2.3" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "yargs": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^15.0.1" + } + }, + "yargs-parser": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } } } } diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/package.json b/templates/examples/extensions/js_lambda_hooks/KendraFallback/package.json index 1df2710d3..ec70c1e49 100644 --- a/templates/examples/extensions/js_lambda_hooks/KendraFallback/package.json +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/package.json @@ -9,7 +9,7 @@ }, "repository": {}, "devDependencies": { - "mocha": "^8.0.1" + "mocha": "^8.1.1" }, "scripts": { "test": "mocha" diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/context_FAQ_md.json b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/context_FAQ_md.json index fe15158c2..9fa21fa26 100644 --- a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/context_FAQ_md.json +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/context_FAQ_md.json @@ -1,10 +1,10 @@ { "callbackWaitsForEmptyEventLoop": true, "functionVersion": "$LATEST", - "functionName": "QNAbot-dev-dev-dev-master-4-Exam-EXTKendraFallback-T1KJ602HXNIW", + "functionName": "QNA-dev-dev-dev-master-2-Example-EXTKendraFallback-1NKAGNPBF6VVY", "memoryLimitInMB": "2048", - "logGroupName": "/aws/lambda/QNAbot-dev-dev-dev-master-4-Exam-EXTKendraFallback-T1KJ602HXNIW", - "logStreamName": "2020/06/23/[$LATEST]9b1c9c2803c64f3db0ee8d14e6ac22d6", - "invokedFunctionArn": "arn:aws:lambda:us-east-1:425742325899:function:QNAbot-dev-dev-dev-master-4-Exam-EXTKendraFallback-T1KJ602HXNIW", - "awsRequestId": "9ab26fab-6b8c-4c14-8287-cbc8a48179f3" + "logGroupName": "/aws/lambda/QNA-dev-dev-dev-master-2-Example-EXTKendraFallback-1NKAGNPBF6VVY", + "logStreamName": "2020/07/02/[$LATEST]e5eaf1b6bade474a82aa21a378b9a71f", + "invokedFunctionArn": "arn:aws:lambda:us-east-1:425742325899:function:QNA-dev-dev-dev-master-2-Example-EXTKendraFallback-1NKAGNPBF6VVY", + "awsRequestId": "a0665572-c2b8-424f-a22e-502f6bb317cb" } diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/event_FAQ_md.json b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/event_FAQ_md.json index 11d45b59c..3c6c071e4 100644 --- a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/event_FAQ_md.json +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/event_FAQ_md.json @@ -3,17 +3,17 @@ "_event": { "messageVersion": "1.0", "invocationSource": "FulfillmentCodeHook", - "userId": "us-east-1:05aef6ae-bc99-41a5-98ad-3d74df5b4bc1", + "userId": "us-east-1:7ace124d-bfd1-4356-ac5a-ed8a98785fd9", "sessionAttributes": {}, "requestAttributes": null, "bot": { - "name": "QNAbot_dev_dev_dev_master_four_BotoNDIv", + "name": "QNA_dev_dev_dev_master_two_BotUSFgl", "alias": "live", "version": "1" }, "outputDialogMode": "Text", "currentIntent": { - "name": "fulfilment_IntentrDEldIYchy", + "name": "fulfilment_IntentfiuhxvkSil", "slots": { "slot": "How many planets orbit the sun" }, @@ -29,7 +29,6 @@ "recentIntentSummaryView": null, "sentimentResponse": null, "kendraResponse": null, - "origQuestion": "How many planets orbit the sun?", "errorFound": false }, "_settings": { @@ -50,7 +49,7 @@ "SMS_HINT_REMINDER": " (Feedback? Reply THUMBS UP or THUMBS DOWN. Ask HELP ME at any time)", "SMS_HINT_REMINDER_INTERVAL_HRS": "24", "IDENTITY_PROVIDER_JWKS_URLS": [], - "ENABLE_MULTI_LANGUAGE_SUPPORT": "true", + "ENABLE_MULTI_LANGUAGE_SUPPORT": "false", "MINIMUM_CONFIDENCE_SCORE": 0.6, "ALT_SEARCH_KENDRA_INDEXES": "[\"e1c23860-e5c8-4409-ae26-b05bd6ced00a\"]", "ELICIT_RESPONSE_MAX_RETRIES": 3, @@ -59,30 +58,26 @@ "ELICIT_RESPONSE_DEFAULT_MSG": "Ok. ", "ENABLE_REDACTING": "false", "REDACTING_REGEX": "\\b\\d{4}\\b(?![-])|\\b\\d{9}\\b|\\b\\d{3}-\\d{2}-\\d{4}\\b", - "DEFAULT_USER_POOL_JWKS_URL": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_EZg5Ia82Z/.well-known/jwks.json" + "DEFAULT_USER_POOL_JWKS_URL": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_jt2cXkCEb/.well-known/jwks.json" }, "_type": "LEX", - "_userId": "us-east-1:05aef6ae-bc99-41a5-98ad-3d74df5b4bc1", + "_userId": "us-east-1:7ace124d-bfd1-4356-ac5a-ed8a98785fd9", "question": "How many planets orbit the sun?", - "session": { - "userDetectedLocale": "en", - "userDetectedLocaleConfidence": 0.9948722720146179, - "userLocale": "en" - }, + "session": {}, "_preferredResponseType": "PlainText", "_userInfo": { - "UserId": "us-east-1:05aef6ae-bc99-41a5-98ad-3d74df5b4bc1", + "UserId": "us-east-1:7ace124d-bfd1-4356-ac5a-ed8a98785fd9", "InteractionCount": 0, - "TimeSinceLastInteraction": 1592902513.847 + "TimeSinceLastInteraction": 1593663418.209 }, "_info": { "es": { - "address": "search-qnabot-elasti-4n2sjlh1tlwf-ziyzyejzynvs6rs2cvx7yaqxma.us-east-1.es.amazonaws.com", - "index": "qnabot-dev-dev-dev-master-4", + "address": "search-qna-dev-elasti-mtl6ojldf3ja-w5begr25vpfuyidnlgb4izlbtq.us-east-1.es.amazonaws.com", + "index": "qna-dev-dev-dev-master-2", "type": "qna", "service": { - "qid": "QNAbot-dev-dev-dev-master-4-ESQidLambda-636ARD1AGUJH", - "proxy": "QNAbot-dev-dev-dev-master-4-ESProxyLambda-NF5QMNB8RE00" + "qid": "QNA-dev-dev-dev-master-2-ESQidLambda-1I9JEHU6U4K9I", + "proxy": "QNA-dev-dev-dev-master-2-ESProxyLambda-1NMAY6LNBRJDY" } } } @@ -91,9 +86,6 @@ "type": "PlainText", "message": "The Kendra Fallback search was not able to identify any results", "session": { - "userDetectedLocale": "en", - "userDetectedLocaleConfidence": 0.9948722720146179, - "userLocale": "en", "appContext": { "altMessages": {} }, @@ -116,11 +108,11 @@ "url": "" }, "_userInfo": { - "UserId": "us-east-1:05aef6ae-bc99-41a5-98ad-3d74df5b4bc1", + "UserId": "us-east-1:7ace124d-bfd1-4356-ac5a-ed8a98785fd9", "InteractionCount": 1, - "TimeSinceLastInteraction": 1592902513.847, - "FirstSeen": "Tue Jun 23 2020 20:55:13 GMT+0000 (Coordinated Universal Time)", - "LastSeen": "Tue Jun 23 2020 20:55:13 GMT+0000 (Coordinated Universal Time)" + "TimeSinceLastInteraction": 1593663418.209, + "FirstSeen": "Thu Jul 02 2020 16:16:58 GMT+0000 (Coordinated Universal Time)", + "LastSeen": "Thu Jul 02 2020 16:16:58 GMT+0000 (Coordinated Universal Time)" }, "got_hits": 0, "result": { diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/event_top_ans.json b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/event_top_ans.json index efdbdf954..dc3b499bd 100644 --- a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/event_top_ans.json +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/event_top_ans.json @@ -16,8 +16,8 @@ "kendraResultId":"09c519d4-4b9a-4355-a586-e25e64285c4f-3527f152-b335-4619-a934-b5d7eecd1982", "kendraResponsibleQid": "KendraFallback" } - } - "userDetectedLocale": "en", + }, + "userDetectedLocale": "en" }, "requestAttributes": null, "bot": { diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/kendraData_FAQ_md.json b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/kendraData_FAQ_md.json index ab0c63db0..c2d3098da 100644 --- a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/kendraData_FAQ_md.json +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/kendraData_FAQ_md.json @@ -1,8 +1,8 @@ { - "QueryId": "ec35a915-8990-4ef7-a5da-f490911cad42", + "QueryId": "b904542d-af85-447d-808b-d86b5df16c06", "ResultItems": [ { - "Id": "ec35a915-8990-4ef7-a5da-f490911cad42-2db7aa5b-1fcb-4910-a2fc-b3922a6069e3", + "Id": "b904542d-af85-447d-808b-d86b5df16c06-ee0db51d-15f4-4786-9144-b51d29d37f66", "Type": "QUESTION_ANSWER", "AdditionalAttributes": [ { @@ -10,7 +10,7 @@ "ValueType": "TEXT_WITH_HIGHLIGHTS_VALUE", "Value": { "TextWithHighlightsValue": { - "Text": "How many planets orbit the Sun", + "Text": "How many planets orbit the Sun?", "Highlights": [ { "BeginOffset": 4, @@ -41,7 +41,7 @@ "ValueType": "TEXT_WITH_HIGHLIGHTS_VALUE", "Value": { "TextWithHighlightsValue": { - "Text": "Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto", + "Text": "Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto.", "Highlights": [ { "BeginOffset": 6, @@ -63,26 +63,26 @@ } } ], - "DocumentId": "c8e0762c86ee7fc92f253ce925b1ecbd101479541164cc5afac09fb027c659dd1592335726833", + "DocumentId": "a212c9bbe37131a9777efc915d837915ee33e5b327ec7df4645cb96d6d165f4a1593702980960", "DocumentTitle": { "Text": "" }, "DocumentExcerpt": { - "Text": "Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto", + "Text": "Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto.", "Highlights": [ { "BeginOffset": 0, - "EndOffset": 146, + "EndOffset": 147, "TopAnswer": false } ] }, - "DocumentURI": "", + "DocumentURI": "{\"args\":[\"\"],\"next\":\"\",\"a\":\"Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto.\",\"r\":{\"buttons\":[{\"text\":\"What is a solar flare?\",\"value\":\"What is a solar flare\"}],\"subTitle\":\"\",\"imageUrl\":\"\",\"title\":\"Suggestions\",\"text\":\"\",\"url\":\"\"},\"t\":\"\",\"alt\":{\"markdown\":\"\",\"ssml\":\"\"},\"l\":\"\",\"qid\":\"sun.10\",\"type\":\"qna\",\"q\":[\"How many planets orbit the Sun?\",\"Which planets orbit the Sun?\"]}", "DocumentAttributes": [ { "Key": "_source_uri", "Value": { - "StringValue": "" + "StringValue": "{\"args\":[\"\"],\"next\":\"\",\"a\":\"Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto.\",\"r\":{\"buttons\":[{\"text\":\"What is a solar flare?\",\"value\":\"What is a solar flare\"}],\"subTitle\":\"\",\"imageUrl\":\"\",\"title\":\"Suggestions\",\"text\":\"\",\"url\":\"\"},\"t\":\"\",\"alt\":{\"markdown\":\"\",\"ssml\":\"\"},\"l\":\"\",\"qid\":\"sun.10\",\"type\":\"qna\",\"q\":[\"How many planets orbit the Sun?\",\"Which planets orbit the Sun?\"]}" } } ] diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/mockClient1.js b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/mockClient1.js new file mode 100644 index 000000000..6c4381f0f --- /dev/null +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/mockClient1.js @@ -0,0 +1,7 @@ +// mockClient.js + +// query calls func(err, data) to return the Data from Kendra JSON from the CloudWatch log +exports.query = function(params, func) { + const data = require('./kendraData_FAQ_md.json'); + func(undefined, data); +}; diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/run_test.js b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/run_test.js index 0dfafbe6a..d59d9c278 100644 --- a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/run_test.js +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/run_test.js @@ -6,7 +6,7 @@ const kendraFallback = require('../KendraFallback.js'); async function test_markdown() { const event = require('./event_FAQ_md.json'); const context = require('./context_FAQ_md.json'); - event.test = true; + event.test = 1; const actual_resp = await kendraFallback.handler(event, context); return actual_resp; } @@ -14,7 +14,7 @@ async function test_markdown() { async function test_top_ans() { const event = require('./event_top_ans.json'); const context = require('./context_top_ans.json'); - event.test2 = true; + event.test = 2; const actual_resp = await kendraFallback.handler(event, context); return actual_resp; } @@ -22,7 +22,7 @@ async function test_top_ans() { async function test_doc_query() { const event = require('./event_doc_query.json'); const context = require('./context_doc_query.json'); - event.test3 = true; + event.test = 3; const actual_resp = await kendraFallback.handler(event, context); return actual_resp; } @@ -34,7 +34,7 @@ describe('#test_kendra_highlights()', () => { // tests that in markdown format, highlights are boldened assert.equal(resp.res.session.appContext.altMessages.markdown, - "*Answer from Amazon Kendra FAQ.* \n \n\nEight **planets** **orbit** the **sun**. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto"); + "*Answer from Amazon Kendra FAQ.* \n \n\nEight **planets** **orbit** the **sun**. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto."); }); it('test_top_answer', async function() { let resp = await test_top_ans(); @@ -53,6 +53,10 @@ describe('#test_kendra_highlights()', () => { // tests that when querying an unstructured document, highlights are boldened in the excerpts when no top answer is found assert.equal(resp.res.session.appContext.altMessages.markdown, "*While I did not find an exact answer, these search results from Amazon Kendra might be helpful.* \n \n\nAnatomy of the Sun Mysteries of the Sun **The Sun is an incandescent mass of hydrogen, helium, and other heavier elements**. While it appears constant and unchanging from our vantage point on Earth, it actually has a dynamic and variable system of twisting magnetic fields that cause solar events of almost unimaginable power. The Convection Zone Energy continues to move toward the surface through convection currents of heated and cooled gas in the convection zone. The Radiative Zone Energy moves slowly outward—taking more than 170,000 years to radiate through the layer of the **Sun** known as the radiative zone.\n\n Source Link: [https://s3.us-east-1.amazonaws.com/explore-kendra-solar/637244main_MysteriesOfTheSun_Book.pdf](https://s3.us-east-1.amazonaws.com/explore-kendra-solar/637244main_MysteriesOfTheSun_Book.pdf)\n\n***\n\n
\n\n ...Mass 1.989 × 1030 kg Density 1.409 g/cm3 **Composition** 92.1% hydrogen, 7.8% helium, 0.1% other elements Surface Temperature (Photosphere) 5,500 deg C (10,000 deg F) Luminosity* 3.83 × 1033 ergs/sec *The total energy radiated by the **Sun** (or any star) per second at all wavelengths...\n\n Source Link: [https://s3.us-east-1.amazonaws.com/explore-kendra-solar/Sun_Lithograph.pdf](https://s3.us-east-1.amazonaws.com/explore-kendra-solar/Sun_Lithograph.pdf)\n\n***\n\n
\n\n ...gases may contribute to a change in tempera- ture or water **composition** in the atmosphere. Stratosphere 10–31 Miles The ozone layer lies within the stratosphere and absorbs ultraviolet radiation from the **Sun**. Troposphere 0–10 Miles The troposphere is the layer of the...\n\n Source Link: [https://s3.us-east-1.amazonaws.com/explore-kendra-solar/637244main_MysteriesOfTheSun_Book.pdf](https://s3.us-east-1.amazonaws.com/explore-kendra-solar/637244main_MysteriesOfTheSun_Book.pdf)"); + + // tests that when querying an unstructured document, the SSML response returns the longest highlight from the response when no top answer is found + assert.equal(resp.res.session.appContext.altMessages.ssml, + " Anatomy of the Sun Mysteries of the Sun The Sun is an incandescent mass of hydrogen, helium, and other heavier elements. While it appears constant and unchanging from our vantage point on Earth, it actually has a dynamic and variable system of twisting magnetic fields that cause solar events of almost unimaginable power "); }); }); diff --git a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/sample_return.json b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/sample_return.json index c443cd836..87858a060 100644 --- a/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/sample_return.json +++ b/templates/examples/extensions/js_lambda_hooks/KendraFallback/test/sample_return.json @@ -3,17 +3,17 @@ "_event": { "messageVersion": "1.0", "invocationSource": "FulfillmentCodeHook", - "userId": "us-east-1:05aef6ae-bc99-41a5-98ad-3d74df5b4bc1", + "userId": "us-east-1:7ace124d-bfd1-4356-ac5a-ed8a98785fd9", "sessionAttributes": {}, "requestAttributes": null, "bot": { - "name": "QNAbot_dev_dev_dev_master_four_BotoNDIv", + "name": "QNA_dev_dev_dev_master_two_BotUSFgl", "alias": "live", "version": "1" }, "outputDialogMode": "Text", "currentIntent": { - "name": "fulfilment_IntentrDEldIYchy", + "name": "fulfilment_IntentfiuhxvkSil", "slots": { "slot": "How many planets orbit the sun" }, @@ -29,7 +29,6 @@ "recentIntentSummaryView": null, "sentimentResponse": null, "kendraResponse": null, - "origQuestion": "How many planets orbit the sun?", "errorFound": false }, "_settings": { @@ -50,7 +49,7 @@ "SMS_HINT_REMINDER": " (Feedback? Reply THUMBS UP or THUMBS DOWN. Ask HELP ME at any time)", "SMS_HINT_REMINDER_INTERVAL_HRS": "24", "IDENTITY_PROVIDER_JWKS_URLS": [], - "ENABLE_MULTI_LANGUAGE_SUPPORT": "true", + "ENABLE_MULTI_LANGUAGE_SUPPORT": "false", "MINIMUM_CONFIDENCE_SCORE": 0.6, "ALT_SEARCH_KENDRA_INDEXES": "[\"e1c23860-e5c8-4409-ae26-b05bd6ced00a\"]", "ELICIT_RESPONSE_MAX_RETRIES": 3, @@ -59,45 +58,38 @@ "ELICIT_RESPONSE_DEFAULT_MSG": "Ok. ", "ENABLE_REDACTING": "false", "REDACTING_REGEX": "\\b\\d{4}\\b(?![-])|\\b\\d{9}\\b|\\b\\d{3}-\\d{2}-\\d{4}\\b", - "DEFAULT_USER_POOL_JWKS_URL": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_EZg5Ia82Z/.well-known/jwks.json" + "DEFAULT_USER_POOL_JWKS_URL": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_jt2cXkCEb/.well-known/jwks.json" }, "_type": "LEX", - "_userId": "us-east-1:05aef6ae-bc99-41a5-98ad-3d74df5b4bc1", + "_userId": "us-east-1:7ace124d-bfd1-4356-ac5a-ed8a98785fd9", "question": "How many planets orbit the sun?", - "session": { - "userDetectedLocale": "en", - "userDetectedLocaleConfidence": 0.9948722720146179, - "userLocale": "en" - }, + "session": {}, "_preferredResponseType": "PlainText", "_userInfo": { - "UserId": "us-east-1:05aef6ae-bc99-41a5-98ad-3d74df5b4bc1", + "UserId": "us-east-1:7ace124d-bfd1-4356-ac5a-ed8a98785fd9", "InteractionCount": 0, - "TimeSinceLastInteraction": 1592902513.847 + "TimeSinceLastInteraction": 1593663418.209 }, "_info": { "es": { - "address": "search-qnabot-elasti-4n2sjlh1tlwf-ziyzyejzynvs6rs2cvx7yaqxma.us-east-1.es.amazonaws.com", - "index": "qnabot-dev-dev-dev-master-4", + "address": "search-qna-dev-elasti-mtl6ojldf3ja-w5begr25vpfuyidnlgb4izlbtq.us-east-1.es.amazonaws.com", + "index": "qna-dev-dev-dev-master-2", "type": "qna", "service": { - "qid": "QNAbot-dev-dev-dev-master-4-ESQidLambda-636ARD1AGUJH", - "proxy": "QNAbot-dev-dev-dev-master-4-ESProxyLambda-NF5QMNB8RE00" + "qid": "QNA-dev-dev-dev-master-2-ESQidLambda-1I9JEHU6U4K9I", + "proxy": "QNA-dev-dev-dev-master-2-ESProxyLambda-1NMAY6LNBRJDY" } } } }, "res": { "type": "PlainText", - "message": "Answer from Amazon Kendra FAQ.\n\n Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto", + "message": "Answer from Amazon Kendra FAQ.\n\n Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto.", "session": { - "userDetectedLocale": "en", - "userDetectedLocaleConfidence": 0.9948722720146179, - "userLocale": "en", "appContext": { "altMessages": { - "markdown": "*Answer from Amazon Kendra FAQ.* \n \n\n Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto", - "ssml": " Answer from Amazon Kendra FAQ. Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune " + "markdown": "*Answer from Amazon Kendra FAQ.* \n \n\nEight **planets** **orbit** the **sun**. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto.", + "ssml": " Answer from Amazon Kendra FAQ. Eight planets orbit the sun. Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. Sorry I'm required to leave out my favorite, Pluto " } }, "previous": { @@ -127,11 +119,11 @@ "url": "" }, "_userInfo": { - "UserId": "us-east-1:05aef6ae-bc99-41a5-98ad-3d74df5b4bc1", + "UserId": "us-east-1:7ace124d-bfd1-4356-ac5a-ed8a98785fd9", "InteractionCount": 1, - "TimeSinceLastInteraction": 1592902513.847, - "FirstSeen": "Tue Jun 23 2020 20:55:13 GMT+0000 (Coordinated Universal Time)", - "LastSeen": "Tue Jun 23 2020 20:55:13 GMT+0000 (Coordinated Universal Time)" + "TimeSinceLastInteraction": 1593663418.209, + "FirstSeen": "Thu Jul 02 2020 16:16:58 GMT+0000 (Coordinated Universal Time)", + "LastSeen": "Thu Jul 02 2020 16:16:58 GMT+0000 (Coordinated Universal Time)" }, "got_hits": 0, "result": { diff --git a/templates/examples/extensions/ui_imports/package-lock.json b/templates/examples/extensions/ui_imports/package-lock.json index 4e512d060..5733a6c6e 100644 --- a/templates/examples/extensions/ui_imports/package-lock.json +++ b/templates/examples/extensions/ui_imports/package-lock.json @@ -33,9 +33,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "minimist": { "version": "1.2.5", diff --git a/templates/examples/extensions/ui_imports/package.json b/templates/examples/extensions/ui_imports/package.json index 3b941f034..d95c088d0 100644 --- a/templates/examples/extensions/ui_imports/package.json +++ b/templates/examples/extensions/ui_imports/package.json @@ -12,6 +12,6 @@ "bluebird": "^3.5.1", "cfn-response": "^1.0.1", "handlebars": "^4.7.6", - "lodash": "^4.17.4" + "lodash": "^4.17.19" } } diff --git a/templates/export/bucket.js b/templates/export/bucket.js index 975af3835..b72ea374d 100644 --- a/templates/export/bucket.js +++ b/templates/export/bucket.js @@ -12,7 +12,15 @@ module.exports={ Name:"prefix", Value:"status" }]}} - }] + },{ + LambdaFunctionArn:{"Fn::GetAtt":["KendraSyncLambda","Arn"]}, + Events:["s3:ObjectCreated:*"], + Filter:{Key:{FilterRules:[{ + Name:"prefix", + Value:"kendra-data" + }]}} + } + ] } } }, @@ -25,6 +33,16 @@ module.exports={ "SourceAccount": {"Ref": "AWS::AccountId"}, "SourceArn":{"Fn::Sub":"arn:aws:s3:::${ExportBucket}"} } + }, + "KendraSyncPermission":{ + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName":{"Fn::GetAtt":["KendraSyncLambda","Arn"]}, + "Action": "lambda:InvokeFunction", + "Principal": "s3.amazonaws.com", + "SourceAccount": {"Ref": "AWS::AccountId"}, + "SourceArn":{"Fn::Sub":"arn:aws:s3:::${ExportBucket}"} + } } } diff --git a/templates/export/index.js b/templates/export/index.js index e87dbcb55..926cd387d 100644 --- a/templates/export/index.js +++ b/templates/export/index.js @@ -19,6 +19,8 @@ module.exports={ "VarIndex": {"Type":"String"}, "EsEndpoint": {"Type":"String"}, "EsProxyLambda": {"Type":"String"}, - "ExportBucket": {"Type":"String"} + "ExportBucket": {"Type":"String"}, + "DefaultQnABotSettings": {"Type":"String"}, + "CustomQnABotSettings": {"Type":"String"}, } } \ No newline at end of file diff --git a/templates/export/resources.js b/templates/export/resources.js index 1e2bfd083..97f8b0b64 100644 --- a/templates/export/resources.js +++ b/templates/export/resources.js @@ -16,6 +16,15 @@ module.exports=Object.assign( "BuildDate":(new Date()).toISOString() } }, + "SyncCodeVersion":{ + "Type": "Custom::S3Version", + "Properties": { + "ServiceToken": { "Ref" : "CFNLambda" }, + "Bucket": {"Ref":"BootstrapBucket"}, + "Key": {"Fn::Sub":"${BootstrapPrefix}/lambda/export.zip"}, + "BuildDate":(new Date()).toISOString() + } + }, "ExportStepLambda": { "Type": "AWS::Lambda::Function", "Properties": { @@ -91,6 +100,169 @@ module.exports=Object.assign( "ServiceToken": { "Ref" : "CFNLambda" }, "Bucket":{"Ref":"ExportBucket"} } + }, + "ExportStepLambda": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": {"Ref":"BootstrapBucket"}, + "S3Key": {"Fn::Sub":"${BootstrapPrefix}/lambda/export.zip"}, + "S3ObjectVersion":{"Ref":"ExportCodeVersion"} + }, + "Environment": { + "Variables": { + ES_INDEX:{"Ref":"VarIndex"}, + ES_ENDPOINT:{"Ref":"EsEndpoint"}, + ES_PROXY:{"Ref":"EsProxyLambda"} + } + }, + "Handler": "index.step", + "MemorySize": "1024", + "Role": {"Fn::GetAtt": ["ExportRole","Arn"]}, + "Runtime": "nodejs10.x", + "Timeout": 300, + "Tags":[{ + Key:"Type", + Value:"Export" + }] + } + }, + "KendraSyncLambda": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": {"Ref":"BootstrapBucket"}, + "S3Key": {"Fn::Sub":"${BootstrapPrefix}/lambda/export.zip"}, + "S3ObjectVersion":{"Ref":"SyncCodeVersion"} + }, + "Environment": { + "Variables": { + "DEFAULT_SETTINGS_PARAM":{"Ref":"DefaultQnABotSettings"}, + "CUSTOM_SETTINGS_PARAM":{"Ref":"CustomQnABotSettings"}, + "OUTPUT_S3_BUCKET":{"Ref":"ExportBucket"}, + "KENDRA_ROLE":{"Fn::GetAtt": ["KendraS3Role","Arn"]}, + "REGION":{"Ref":"AWS::Region"} + } + }, + "Handler": "kendraSync.performSync", + "MemorySize": "1024", + "Role": {"Fn::GetAtt": ["KendraSyncRole","Arn"]}, + "Runtime": "nodejs10.x", + "Timeout": 300, + "Tags":[{ + Key:"Type", + Value:"Sync" + }] + } + }, + "KendraSyncRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + },{ + "Effect": "Allow", + "Principal": { + "Service": "kendra.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "Path": "/", + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + {"Ref":"KendraSyncPolicy"} + ] + } + }, + "KendraSyncPolicy": { + "Type": "AWS::IAM::ManagedPolicy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + // TODO: split the statements up + "Statement": [{ + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:Get*", + "s3:List*", + "kendra:CreateFaq", + "kendra:ListFaqs", + "kendra:TagResource", + "kendra:DeleteFaq", + "iam:passRole", + "ssm:getParameter" + ], + "Resource": [ + {"Fn::Sub":"arn:aws:kendra:${AWS::Region}:${AWS::AccountId}:index/*"}, + {"Fn::Sub":"arn:aws:kendra:${AWS::Region}:${AWS::AccountId}:index/*/faq/*"}, + {"Fn::Sub":"arn:aws:s3:::${ExportBucket}"}, + {"Fn::Sub":"arn:aws:s3:::${ExportBucket}/*"}, + {"Fn::GetAtt": ["KendraS3Role","Arn"]}, + {"Fn::Sub":"arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:*"} + ] + }] + } + } + }, + "KendraS3Role": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + },{ + "Effect": "Allow", + "Principal": { + "Service": "kendra.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "Path": "/", + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + {"Ref":"KendraS3Policy"} + ] + } + }, + "KendraS3Policy": { + "Type": "AWS::IAM::ManagedPolicy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [{ + "Effect": "Allow", + "Action": [ + "s3:GetObject", + "kendra:CreateFaq", + ], + "Resource": [ + {"Fn::Sub":"arn:aws:kendra:${AWS::Region}:${AWS::AccountId}:index/*"}, + {"Fn::Sub":"arn:aws:s3:::${ExportBucket}"}, + {"Fn::Sub":"arn:aws:s3:::${ExportBucket}/*"}, + ] + }] + } + } } -}) + } +) + diff --git a/templates/import/UpgradeAutoImport.js b/templates/import/UpgradeAutoImport.js index 9804e45bf..2bdaae9e4 100644 --- a/templates/import/UpgradeAutoImport.js +++ b/templates/import/UpgradeAutoImport.js @@ -17,6 +17,7 @@ module.exports={ id:exportfile, index:{"Ref":"VarIndex"}, encryption:{"Ref":"Encryption"}, + es_endpoint:{"Ref":"EsEndpoint"}, } }, "PostUpgradeImportMetrics":{ @@ -29,6 +30,7 @@ module.exports={ id:exportfile_metrics, index:{"Ref":"MetricsIndex"}, encryption:{"Ref":"Encryption"}, + es_endpoint:{"Ref":"EsEndpoint"}, } }, "PostUpgradeImportFeedback":{ @@ -41,6 +43,7 @@ module.exports={ id:exportfile_feedback, index:{"Ref":"FeedbackIndex"}, encryption:{"Ref":"Encryption"}, + es_endpoint:{"Ref":"EsEndpoint"}, } }, } diff --git a/templates/master/default-settings.js b/templates/master/default-settings.js index 4ba32586d..d13198c81 100644 --- a/templates/master/default-settings.js +++ b/templates/master/default-settings.js @@ -12,6 +12,10 @@ var default_settings = { ENABLE_MULTI_LANGUAGE_SUPPORT: "false", //User can override and set to true to Enable Multilanguage support MINIMUM_CONFIDENCE_SCORE: 0.6, //User can override this value to set the minimum confidence they accept using CustomQnABotSettings ALT_SEARCH_KENDRA_INDEXES: [], // Add Kendra index to array to enable Amazon Kendra as a fallback source of answers + KENDRA_FAQ_INDEX: "", // Kendra Index specific for FAQ for if Kendra FAQ sync is enabled + KENDRA_FAQ_CONFIG_MAX_RETRIES: 8, //User can override number of max retries in AWS SDK configurations + KENDRA_FAQ_CONFIG_RETRY_DELAY: 600, //User can override number of miliseconds delay between retries in AWS SDK configurations + KENDRA_FAQ_ES_FALLBACK: "true", // Optional ElasticSearch Fallback engine for if KendraFAQ fails ERRORMESSAGE: "Unfortunately I encountered an error when searching for your answer. Please ask me again later.", EMPTYMESSAGE: "You stumped me! Sadly I don't know how to answer your question.", DEFAULT_ALEXA_LAUNCH_MESSAGE: "Hello, Please ask a question", diff --git a/templates/master/elasticsearch/es.js b/templates/master/elasticsearch/es.js index bd3c73f34..2fd562994 100644 --- a/templates/master/elasticsearch/es.js +++ b/templates/master/elasticsearch/es.js @@ -11,7 +11,7 @@ var properties={ "VolumeSize": 10, "VolumeType": "gp2" }, - "ElasticsearchVersion": "7.4", + "ElasticsearchVersion": "7.7", "SnapshotOptions": { "AutomatedSnapshotStartHour": "0" }, diff --git a/templates/master/elasticsearch/kibana/QnABotDashboard.json b/templates/master/elasticsearch/kibana/QnABotDashboard.json index 71740505f..a20e6f39a 100644 --- a/templates/master/elasticsearch/kibana/QnABotDashboard.json +++ b/templates/master/elasticsearch/kibana/QnABotDashboard.json @@ -1,57 +1,68 @@ { - "version": "7.4.2", + "version": "7.7.0", "objects": [ { "id": "052b1350-a37d-11ea-8370-0f1df276cae1", "type": "dashboard", - "updated_at": "2020-06-10T19:31:58.053Z", - "version": "WzAsMV0=", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzM2LDFd", "attributes": { - "hits": "0", "description": "Visualize QnABot usage, see what your users are asking, and use the \"No Hits\" and \"Feedback\" charts to assess where you should add or tune QnABot content to make the bot smarter. ", - "title": "QnABot Dashboard", - "timeRestore": "false", - "version": "1", - "panelsJSON": "[{\"version\":\"7.4.2\",\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"fb115451-3b8a-436f-b916-8a04db4e9d70\"},\"panelIndex\":\"fb115451-3b8a-436f-b916-8a04db4e9d70\",\"embeddableConfig\":{},\"panelRefName\":\"panel_0\"},{\"version\":\"7.4.2\",\"gridData\":{\"x\":24,\"y\":0,\"w\":24,\"h\":15,\"i\":\"5e25d094-b045-4afe-953d-2d619b05b716\"},\"panelIndex\":\"5e25d094-b045-4afe-953d-2d619b05b716\",\"embeddableConfig\":{},\"panelRefName\":\"panel_1\"},{\"version\":\"7.4.2\",\"gridData\":{\"x\":0,\"y\":15,\"w\":24,\"h\":15,\"i\":\"b9b730b1-b3de-42f9-a4de-69197d934a93\"},\"panelIndex\":\"b9b730b1-b3de-42f9-a4de-69197d934a93\",\"embeddableConfig\":{},\"panelRefName\":\"panel_2\"},{\"version\":\"7.4.2\",\"gridData\":{\"x\":24,\"y\":15,\"w\":24,\"h\":15,\"i\":\"472ff8b6-83bf-4e4d-a8a5-44ce8f7e3dac\"},\"panelIndex\":\"472ff8b6-83bf-4e4d-a8a5-44ce8f7e3dac\",\"embeddableConfig\":{},\"panelRefName\":\"panel_3\"},{\"version\":\"7.4.2\",\"gridData\":{\"x\":0,\"y\":30,\"w\":24,\"h\":15,\"i\":\"92e5cbb2-fa56-4f15-b7b1-72c11e0bebfc\"},\"panelIndex\":\"92e5cbb2-fa56-4f15-b7b1-72c11e0bebfc\",\"embeddableConfig\":{},\"panelRefName\":\"panel_4\"},{\"version\":\"7.4.2\",\"gridData\":{\"x\":24,\"y\":30,\"w\":24,\"h\":15,\"i\":\"7ca7cdb0-2472-4eb0-bf7e-ae90f238f869\"},\"panelIndex\":\"7ca7cdb0-2472-4eb0-bf7e-ae90f238f869\",\"embeddableConfig\":{},\"panelRefName\":\"panel_5\"},{\"version\":\"7.4.2\",\"gridData\":{\"x\":0,\"y\":45,\"w\":10,\"h\":8,\"i\":\"cba70b74-3264-4153-87d2-68c24b552efa\"},\"panelIndex\":\"cba70b74-3264-4153-87d2-68c24b552efa\",\"embeddableConfig\":{},\"panelRefName\":\"panel_6\"}]", - "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", + "hits": "0", "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}" - } + }, + "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", + "panelsJSON": "[{\"version\":\"7.7.0\",\"gridData\":{\"h\":15,\"i\":\"fb115451-3b8a-436f-b916-8a04db4e9d70\",\"w\":17,\"x\":0,\"y\":0},\"panelIndex\":\"fb115451-3b8a-436f-b916-8a04db4e9d70\",\"embeddableConfig\":{\"vis\":{\"legendOpen\":true},\"legendOpen\":false},\"panelRefName\":\"panel_0\"},{\"version\":\"7.7.0\",\"gridData\":{\"h\":15,\"i\":\"5e25d094-b045-4afe-953d-2d619b05b716\",\"w\":14,\"x\":34,\"y\":0},\"panelIndex\":\"5e25d094-b045-4afe-953d-2d619b05b716\",\"embeddableConfig\":{},\"panelRefName\":\"panel_1\"},{\"version\":\"7.7.0\",\"gridData\":{\"h\":15,\"i\":\"cf017f39-a5a3-4d3a-9561-862f4c2eb3c5\",\"w\":17,\"x\":17,\"y\":0},\"panelIndex\":\"cf017f39-a5a3-4d3a-9561-862f4c2eb3c5\",\"embeddableConfig\":{\"vis\":{\"legendOpen\":true},\"legendOpen\":false},\"panelRefName\":\"panel_2\"},{\"version\":\"7.7.0\",\"gridData\":{\"h\":15,\"i\":\"b9b730b1-b3de-42f9-a4de-69197d934a93\",\"w\":24,\"x\":0,\"y\":15},\"panelIndex\":\"b9b730b1-b3de-42f9-a4de-69197d934a93\",\"embeddableConfig\":{},\"panelRefName\":\"panel_3\"},{\"version\":\"7.7.0\",\"gridData\":{\"h\":15,\"i\":\"472ff8b6-83bf-4e4d-a8a5-44ce8f7e3dac\",\"w\":24,\"x\":24,\"y\":15},\"panelIndex\":\"472ff8b6-83bf-4e4d-a8a5-44ce8f7e3dac\",\"embeddableConfig\":{},\"panelRefName\":\"panel_4\"},{\"version\":\"7.7.0\",\"gridData\":{\"h\":15,\"i\":\"92e5cbb2-fa56-4f15-b7b1-72c11e0bebfc\",\"w\":24,\"x\":0,\"y\":30},\"panelIndex\":\"92e5cbb2-fa56-4f15-b7b1-72c11e0bebfc\",\"embeddableConfig\":{},\"panelRefName\":\"panel_5\"},{\"version\":\"7.7.0\",\"gridData\":{\"h\":15,\"i\":\"7ca7cdb0-2472-4eb0-bf7e-ae90f238f869\",\"w\":24,\"x\":24,\"y\":30},\"panelIndex\":\"7ca7cdb0-2472-4eb0-bf7e-ae90f238f869\",\"embeddableConfig\":{},\"panelRefName\":\"panel_6\"},{\"version\":\"7.7.0\",\"gridData\":{\"h\":8,\"i\":\"cba70b74-3264-4153-87d2-68c24b552efa\",\"w\":10,\"x\":0,\"y\":45},\"panelIndex\":\"cba70b74-3264-4153-87d2-68c24b552efa\",\"embeddableConfig\":{},\"panelRefName\":\"panel_7\"}]", + "refreshInterval": { + "pause": true, + "value": 0 + }, + "timeFrom": "2020-08-18T15:44:48.334Z", + "timeRestore": "false", + "timeTo": "2020-08-18T15:59:17.582Z", + "title": "QnABot Dashboard", + "version": "1" }, "references": [ { - "name": "panel_0", "id": "a66d5ed0-a378-11ea-8370-0f1df276cae1", + "name": "panel_0", "type": "visualization" }, { - "name": "panel_1", "id": "d905b930-a37a-11ea-a346-0f81312f0c3c", + "name": "panel_1", "type": "visualization" }, { + "id": "12d24870-e16c-11ea-b423-5f0e2ad2220e", "name": "panel_2", - "id": "68d7c450-a37a-11ea-8370-0f1df276cae1", "type": "visualization" }, { + "id": "68d7c450-a37a-11ea-8370-0f1df276cae1", "name": "panel_3", - "id": "d68ac390-a379-11ea-8370-0f1df276cae1", "type": "visualization" }, { + "id": "d68ac390-a379-11ea-8370-0f1df276cae1", "name": "panel_4", - "id": "6759e170-a37b-11ea-8370-0f1df276cae1", "type": "visualization" }, { + "id": "6759e170-a37b-11ea-8370-0f1df276cae1", "name": "panel_5", - "id": "985eb570-a37b-11ea-8370-0f1df276cae1", "type": "visualization" }, { + "id": "985eb570-a37b-11ea-8370-0f1df276cae1", "name": "panel_6", + "type": "visualization" + }, + { "id": "2031f610-a4c1-11ea-a012-c353d737e5ec", + "name": "panel_7", "type": "visualization" } ], @@ -62,227 +73,253 @@ { "id": "a66d5ed0-a378-11ea-8370-0f1df276cae1", "type": "visualization", - "updated_at": "2020-07-06T22:29:35.448Z", - "version": "WzE4LDRd", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzI2LDFd", "attributes": { - "title": "Requests", - "visState": "{\"title\":\"Requests\",\"type\":\"histogram\",\"params\":{\"addLegend\":true,\"addTimeMarker\":false,\"addTooltip\":true,\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"labels\":{\"filter\":true,\"show\":true,\"truncate\":100},\"position\":\"bottom\",\"scale\":{\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{},\"type\":\"category\"}],\"dimensions\":{\"x\":{\"accessor\":0,\"format\":{\"id\":\"date\",\"params\":{\"pattern\":\"HH:mm:ss\"}},\"params\":{\"date\":true,\"interval\":\"PT30S\",\"format\":\"HH:mm:ss\",\"bounds\":{\"min\":\"2020-07-06T21:55:15.220Z\",\"max\":\"2020-07-06T22:25:15.220Z\"}},\"aggType\":\"date_histogram\"},\"y\":[{\"accessor\":1,\"format\":{\"id\":\"number\"},\"params\":{},\"aggType\":\"cardinality\"}]},\"grid\":{\"categoryLines\":false},\"labels\":{\"show\":false},\"legendPosition\":\"right\",\"seriesParams\":[{\"data\":{\"id\":\"1\",\"label\":\"Count\"},\"drawLinesBetweenPoints\":true,\"mode\":\"stacked\",\"show\":\"true\",\"showCircles\":true,\"type\":\"histogram\",\"valueAxis\":\"ValueAxis-1\"}],\"thresholdLine\":{\"color\":\"#34130C\",\"show\":false,\"style\":\"full\",\"value\":10,\"width\":1},\"times\":[],\"type\":\"histogram\",\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"labels\":{\"filter\":false,\"rotate\":0,\"show\":true,\"truncate\":100},\"name\":\"LeftAxis-1\",\"position\":\"left\",\"scale\":{\"mode\":\"normal\",\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{\"text\":\"Count\"},\"type\":\"value\"}]},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"datetime\",\"timeRange\":{\"from\":\"now-30m\",\"to\":\"now\"},\"useNormalizedEsInterval\":true,\"interval\":\"auto\",\"drop_partials\":false,\"min_doc_count\":1,\"extended_bounds\":{},\"customLabel\":\"Requests\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"entireRequest.sentiment.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":5,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Sentiment\"}}]}", - "uiStateJSON": "{}", "description": "", - "version": "1", "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" - } + }, + "title": "Requests", + "uiStateJSON": "{}", + "version": "1", + "visState": "{\"title\":\"Requests\",\"type\":\"histogram\",\"params\":{\"addLegend\":true,\"addTimeMarker\":false,\"addTooltip\":true,\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"labels\":{\"filter\":true,\"show\":true,\"truncate\":100},\"position\":\"bottom\",\"scale\":{\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{},\"type\":\"category\"}],\"dimensions\":{\"x\":{\"accessor\":0,\"format\":{\"id\":\"date\",\"params\":{\"pattern\":\"HH:mm:ss\"}},\"params\":{\"date\":true,\"interval\":\"PT30S\",\"format\":\"HH:mm:ss\",\"bounds\":{\"min\":\"2020-07-06T21:55:15.220Z\",\"max\":\"2020-07-06T22:25:15.220Z\"}},\"aggType\":\"date_histogram\"},\"y\":[{\"accessor\":1,\"format\":{\"id\":\"number\"},\"params\":{},\"aggType\":\"cardinality\"}]},\"grid\":{\"categoryLines\":false},\"labels\":{\"show\":false},\"legendPosition\":\"right\",\"seriesParams\":[{\"data\":{\"id\":\"1\",\"label\":\"Count\"},\"drawLinesBetweenPoints\":true,\"mode\":\"stacked\",\"show\":\"true\",\"showCircles\":true,\"type\":\"histogram\",\"valueAxis\":\"ValueAxis-1\"}],\"thresholdLine\":{\"color\":\"#34130C\",\"show\":false,\"style\":\"full\",\"value\":10,\"width\":1},\"times\":[],\"type\":\"histogram\",\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"labels\":{\"filter\":false,\"rotate\":0,\"show\":true,\"truncate\":100},\"name\":\"LeftAxis-1\",\"position\":\"left\",\"scale\":{\"mode\":\"normal\",\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{\"text\":\"Count\"},\"type\":\"value\"}]},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"datetime\",\"timeRange\":{\"from\":\"now-30m\",\"to\":\"now\"},\"useNormalizedEsInterval\":true,\"interval\":\"auto\",\"drop_partials\":false,\"min_doc_count\":1,\"extended_bounds\":{},\"customLabel\":\"Requests\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"entireRequest.sentiment.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":5,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Sentiment\"}}]}" }, "references": [ { + "id": "Metrics", "name": "kibanaSavedObjectMeta.searchSourceJSON.index", - "type": "index-pattern", - "id": "Metrics" + "type": "index-pattern" } ], "migrationVersion": { - "visualization": "7.4.2" + "visualization": "7.7.0" } }, { "id": "d905b930-a37a-11ea-a346-0f81312f0c3c", "type": "visualization", - "updated_at": "2020-06-10T19:31:58.053Z", - "version": "WzIsMV0=", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzI3LDFd", "attributes": { "description": "", - "uiStateJSON": "{}", - "title": "Client Types", - "version": "1", "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" }, + "title": "Client Types", + "uiStateJSON": "{}", + "version": "1", "visState": "{\"title\":\"Client Types\",\"type\":\"pie\",\"params\":{\"type\":\"pie\",\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":false,\"labels\":{\"show\":false,\"values\":true,\"last_level\":true,\"truncate\":100},\"dimensions\":{\"metric\":{\"accessor\":1,\"format\":{\"id\":\"number\"},\"params\":{},\"aggType\":\"count\"},\"buckets\":[{\"accessor\":0,\"format\":{\"id\":\"terms\",\"params\":{\"id\":\"string\",\"otherBucketLabel\":\"Other\",\"missingBucketLabel\":\"Missing\"}},\"params\":{},\"aggType\":\"terms\"}]}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"clientType.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":5,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Client Types\"}}]}" }, "references": [ { - "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "id": "Metrics", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "type": "index-pattern" } ], "migrationVersion": { - "visualization": "7.4.2" + "visualization": "7.7.0" } }, { - "id": "68d7c450-a37a-11ea-8370-0f1df276cae1", + "id": "12d24870-e16c-11ea-b423-5f0e2ad2220e", "type": "visualization", - "updated_at": "2020-06-10T19:31:58.053Z", - "version": "WzMsMV0=", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzI4LDFd", "attributes": { "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "title": "Requests AnswerSource", "uiStateJSON": "{}", - "title": "Logged Utterances", "version": "1", + "visState": "{\"type\":\"histogram\",\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"datetime\",\"timeRange\":{\"from\":\"2020-08-18T15:44:48.334Z\",\"to\":\"2020-08-18T15:59:17.582Z\"},\"useNormalizedEsInterval\":true,\"scaleMetricValues\":false,\"interval\":\"auto\",\"drop_partials\":false,\"min_doc_count\":1,\"extended_bounds\":{},\"customLabel\":\"Requests\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"entireResponse.answerSource.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":5,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Source\"}}],\"params\":{\"addLegend\":true,\"addTimeMarker\":false,\"addTooltip\":true,\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"labels\":{\"filter\":true,\"show\":true,\"truncate\":100},\"position\":\"bottom\",\"scale\":{\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{},\"type\":\"category\"}],\"dimensions\":{\"x\":{\"accessor\":0,\"aggType\":\"date_histogram\",\"format\":{\"id\":\"date\",\"params\":{\"pattern\":\"HH:mm:ss\"}},\"params\":{\"bounds\":{\"max\":\"2020-07-06T22:25:15.220Z\",\"min\":\"2020-07-06T21:55:15.220Z\"},\"date\":true,\"format\":\"HH:mm:ss\",\"interval\":\"PT30S\"}},\"y\":[{\"accessor\":1,\"aggType\":\"cardinality\",\"format\":{\"id\":\"number\"},\"params\":{}}]},\"grid\":{\"categoryLines\":false},\"labels\":{\"show\":false},\"legendPosition\":\"right\",\"seriesParams\":[{\"data\":{\"id\":\"1\",\"label\":\"Count\"},\"drawLinesBetweenPoints\":true,\"mode\":\"stacked\",\"show\":\"true\",\"showCircles\":true,\"type\":\"histogram\",\"valueAxis\":\"ValueAxis-1\"}],\"thresholdLine\":{\"color\":\"#34130C\",\"show\":false,\"style\":\"full\",\"value\":10,\"width\":1},\"times\":[],\"type\":\"histogram\",\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"labels\":{\"filter\":false,\"rotate\":0,\"show\":true,\"truncate\":100},\"name\":\"LeftAxis-1\",\"position\":\"left\",\"scale\":{\"mode\":\"normal\",\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{\"text\":\"Count\"},\"type\":\"value\"}]},\"title\":\"Requests AnswerSource\"}" + }, + "references": [ + { + "id": "Metrics", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + } + ], + "migrationVersion": { + "visualization": "7.7.0" + } + }, + { + "id": "68d7c450-a37a-11ea-8370-0f1df276cae1", + "type": "visualization", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzI5LDFd", + "attributes": { + "description": "", "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" }, + "title": "Logged Utterances", + "uiStateJSON": "{}", + "version": "1", "visState": "{\"title\":\"Logged Utterances\",\"type\":\"tagcloud\",\"params\":{\"scale\":\"linear\",\"orientation\":\"single\",\"minFontSize\":18,\"maxFontSize\":72,\"showLabel\":true,\"metric\":{\"type\":\"vis_dimension\",\"accessor\":0,\"format\":{\"id\":\"string\",\"params\":{}}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"utterance.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":1000,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Logged Utterances\"}}]}" }, "references": [ { - "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "id": "Metrics", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "type": "index-pattern" } ], "migrationVersion": { - "visualization": "7.4.2" + "visualization": "7.7.0" } }, { "id": "d68ac390-a379-11ea-8370-0f1df276cae1", "type": "visualization", - "updated_at": "2020-06-10T19:31:58.053Z", - "version": "WzQsMV0=", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzMwLDFd", "attributes": { "description": "", - "uiStateJSON": "{}", - "title": "No Hits", - "version": "1", "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"query\":{\"query\":\"entireResponse.got_hits:0\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" }, + "title": "No Hits", + "uiStateJSON": "{}", + "version": "1", "visState": "{\"title\":\"No Hits\",\"type\":\"tagcloud\",\"params\":{\"scale\":\"linear\",\"orientation\":\"single\",\"minFontSize\":18,\"maxFontSize\":72,\"showLabel\":true,\"metric\":{\"type\":\"vis_dimension\",\"accessor\":0,\"format\":{\"id\":\"string\",\"params\":{}}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"utterance.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":1000,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"No Hits\"}}]}" }, "references": [ { - "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "id": "Metrics", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "type": "index-pattern" } ], "migrationVersion": { - "visualization": "7.4.2" + "visualization": "7.7.0" } }, { "id": "6759e170-a37b-11ea-8370-0f1df276cae1", "type": "visualization", - "updated_at": "2020-06-10T19:31:58.053Z", - "version": "WzUsMV0=", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzMyLDFd", "attributes": { "description": "", - "uiStateJSON": "{}", - "title": "Positive Feedback", - "version": "1", "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"query\":{\"query\":\"feedback=correct\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" }, + "title": "Positive Feedback", + "uiStateJSON": "{}", + "version": "1", "visState": "{\"title\":\"Positive Feedback\",\"type\":\"tagcloud\",\"params\":{\"scale\":\"linear\",\"orientation\":\"single\",\"minFontSize\":18,\"maxFontSize\":72,\"showLabel\":true,\"metric\":{\"type\":\"vis_dimension\",\"accessor\":0,\"format\":{\"id\":\"string\",\"params\":{}}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"utterance.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":100,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Thumbs Up\"}}]}" }, "references": [ { - "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "id": "Feedback", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "type": "index-pattern" } ], "migrationVersion": { - "visualization": "7.4.2" + "visualization": "7.7.0" } }, { "id": "985eb570-a37b-11ea-8370-0f1df276cae1", "type": "visualization", - "updated_at": "2020-06-10T19:31:58.053Z", - "version": "WzYsMV0=", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzMzLDFd", "attributes": { "description": "", - "uiStateJSON": "{}", - "title": "Negative Feedback", - "version": "1", "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"query\":{\"query\":\"feedback=incorrect\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" }, + "title": "Negative Feedback", + "uiStateJSON": "{}", + "version": "1", "visState": "{\"title\":\"Negative Feedback\",\"type\":\"tagcloud\",\"params\":{\"scale\":\"linear\",\"orientation\":\"single\",\"minFontSize\":18,\"maxFontSize\":72,\"showLabel\":true,\"metric\":{\"type\":\"vis_dimension\",\"accessor\":1,\"format\":{\"id\":\"string\",\"params\":{}}},\"bucket\":{\"type\":\"vis_dimension\",\"accessor\":0,\"format\":{\"id\":\"terms\",\"params\":{\"id\":\"string\",\"otherBucketLabel\":\"Other\",\"missingBucketLabel\":\"Missing\"}}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"utterance.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":100,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Thumbs Down\"}}]}" }, "references": [ { - "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "id": "Feedback", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "type": "index-pattern" } ], "migrationVersion": { - "visualization": "7.4.2" + "visualization": "7.7.0" } }, { "id": "2031f610-a4c1-11ea-a012-c353d737e5ec", "type": "visualization", - "updated_at": "2020-06-10T19:31:58.053Z", - "version": "WzcsMV0=", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzM1LDFd", "attributes": { "description": "", - "uiStateJSON": "{}", - "title": "QnAItemCount", - "version": "1", "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" }, + "title": "QnAItemCount", + "uiStateJSON": "{}", + "version": "1", "visState": "{\"title\":\"QnAItemCount\",\"type\":\"metric\",\"params\":{\"metric\":{\"percentageMode\":false,\"useRanges\":false,\"colorSchema\":\"Green to Red\",\"metricColorMode\":\"None\",\"colorsRange\":[{\"type\":\"range\",\"from\":0,\"to\":10000}],\"labels\":{\"show\":true},\"invertColors\":false,\"style\":{\"bgFill\":\"#000\",\"bgColor\":false,\"labelColor\":false,\"subText\":\"\",\"fontSize\":60}},\"dimensions\":{\"metrics\":[{\"type\":\"vis_dimension\",\"accessor\":0,\"format\":{\"id\":\"number\",\"params\":{}}}]},\"addTooltip\":true,\"addLegend\":false,\"type\":\"metric\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"QnA Item Count\"}}]}" }, "references": [ { - "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "id": "QnaItems", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "type": "index-pattern" } ], "migrationVersion": { - "visualization": "7.4.2" + "visualization": "7.7.0" } }, { "id": "Metrics", "type": "index-pattern", - "updated_at": "2020-07-06T22:24:33.815Z", - "version": "WzE3LDRd", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzI1LDFd", "attributes": { + "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"esTypes\":[\"_type\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"answer\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"answer.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"answer\"}}},{\"name\":\"clientType\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"clientType.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"clientType\"}}},{\"name\":\"datetime\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._clientType\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._clientType.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._clientType\"}}},{\"name\":\"entireRequest._event.bot.alias\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.bot.alias.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.bot.alias\"}}},{\"name\":\"entireRequest._event.bot.name\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.bot.name.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.bot.name\"}}},{\"name\":\"entireRequest._event.bot.version\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.bot.version.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.bot.version\"}}},{\"name\":\"entireRequest._event.currentIntent.confirmationStatus\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.confirmationStatus.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.currentIntent.confirmationStatus\"}}},{\"name\":\"entireRequest._event.currentIntent.name\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.name.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.currentIntent.name\"}}},{\"name\":\"entireRequest._event.currentIntent.slotDetails.slot.originalValue\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.slotDetails.slot.originalValue.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.currentIntent.slotDetails.slot.originalValue\"}}},{\"name\":\"entireRequest._event.currentIntent.slotDetails.slot.resolutions.value\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.slotDetails.slot.resolutions.value.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.currentIntent.slotDetails.slot.resolutions.value\"}}},{\"name\":\"entireRequest._event.currentIntent.slots.slot\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.slots.slot.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.currentIntent.slots.slot\"}}},{\"name\":\"entireRequest._event.errorFound\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._event.inputTranscript\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.inputTranscript.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.inputTranscript\"}}},{\"name\":\"entireRequest._event.invocationSource\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.invocationSource.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.invocationSource\"}}},{\"name\":\"entireRequest._event.messageVersion\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.messageVersion.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.messageVersion\"}}},{\"name\":\"entireRequest._event.outputDialogMode\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.outputDialogMode.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.outputDialogMode\"}}},{\"name\":\"entireRequest._event.recentIntentSummaryView.confirmationStatus\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.confirmationStatus.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.recentIntentSummaryView.confirmationStatus\"}}},{\"name\":\"entireRequest._event.recentIntentSummaryView.dialogActionType\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.dialogActionType.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.recentIntentSummaryView.dialogActionType\"}}},{\"name\":\"entireRequest._event.recentIntentSummaryView.fulfillmentState\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.fulfillmentState.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.recentIntentSummaryView.fulfillmentState\"}}},{\"name\":\"entireRequest._event.recentIntentSummaryView.intentName\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.intentName.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.recentIntentSummaryView.intentName\"}}},{\"name\":\"entireRequest._event.recentIntentSummaryView.slots.slot\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.slots.slot.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.recentIntentSummaryView.slots.slot\"}}},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_gotanswer\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_gotanswer.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.sessionAttributes.qnabot_gotanswer\"}}},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.sessionAttributes.qnabot_qid\"}}},{\"name\":\"entireRequest._event.sessionAttributes.qnabotcontext\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.qnabotcontext.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.sessionAttributes.qnabotcontext\"}}},{\"name\":\"entireRequest._event.userId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.userId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._event.userId\"}}},{\"name\":\"entireRequest._info.es.address\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.address.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._info.es.address\"}}},{\"name\":\"entireRequest._info.es.index\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.index.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._info.es.index\"}}},{\"name\":\"entireRequest._info.es.service.proxy\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.service.proxy.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._info.es.service.proxy\"}}},{\"name\":\"entireRequest._info.es.service.qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.service.qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._info.es.service.qid\"}}},{\"name\":\"entireRequest._info.es.type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._info.es.type\"}}},{\"name\":\"entireRequest._preferredResponseType\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._preferredResponseType.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._preferredResponseType\"}}},{\"name\":\"entireRequest._settings.ALT_SEARCH_KENDRA_INDEXES\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ALT_SEARCH_KENDRA_INDEXES.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ALT_SEARCH_KENDRA_INDEXES\"}}},{\"name\":\"entireRequest._settings.DEFAULT_ALEXA_LAUNCH_MESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.DEFAULT_ALEXA_LAUNCH_MESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.DEFAULT_ALEXA_LAUNCH_MESSAGE\"}}},{\"name\":\"entireRequest._settings.DEFAULT_ALEXA_STOP_MESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.DEFAULT_ALEXA_STOP_MESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.DEFAULT_ALEXA_STOP_MESSAGE\"}}},{\"name\":\"entireRequest._settings.DEFAULT_USER_POOL_JWKS_URL\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.DEFAULT_USER_POOL_JWKS_URL.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.DEFAULT_USER_POOL_JWKS_URL\"}}},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_BOT_FAILURE_MESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_BOT_FAILURE_MESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ELICIT_RESPONSE_BOT_FAILURE_MESSAGE\"}}},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_DEFAULT_MSG\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_DEFAULT_MSG.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ELICIT_RESPONSE_DEFAULT_MSG\"}}},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_MAX_RETRIES\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_RETRY_MESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_RETRY_MESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ELICIT_RESPONSE_RETRY_MESSAGE\"}}},{\"name\":\"entireRequest._settings.EMPTYMESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.EMPTYMESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.EMPTYMESSAGE\"}}},{\"name\":\"entireRequest._settings.ENABLE_DEBUG_RESPONSES\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ENABLE_MULTI_LANGUAGE_SUPPORT\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ENABLE_REDACTING\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ENABLE_SENTIMENT_SUPPORT\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ENFORCE_VERIFIED_IDENTITY\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ERRORMESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ERRORMESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ERRORMESSAGE\"}}},{\"name\":\"entireRequest._settings.ES_KEYWORD_SYNTAX_TYPES\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_KEYWORD_SYNTAX_TYPES.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ES_KEYWORD_SYNTAX_TYPES\"}}},{\"name\":\"entireRequest._settings.ES_MINIMUM_SHOULD_MATCH\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_MINIMUM_SHOULD_MATCH.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ES_MINIMUM_SHOULD_MATCH\"}}},{\"name\":\"entireRequest._settings.ES_NO_HITS_QUESTION\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_NO_HITS_QUESTION.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ES_NO_HITS_QUESTION\"}}},{\"name\":\"entireRequest._settings.ES_PHRASE_BOOST\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_PHRASE_BOOST.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ES_PHRASE_BOOST\"}}},{\"name\":\"entireRequest._settings.ES_SCORE_ANSWER_FIELD\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ES_SYNTAX_CONFIDENCE_LIMIT\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_SYNTAX_CONFIDENCE_LIMIT.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.ES_SYNTAX_CONFIDENCE_LIMIT\"}}},{\"name\":\"entireRequest._settings.ES_USE_FUZZY_MATCH\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ES_USE_KEYWORD_FILTERS\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.KENDRA_FAQ_CONFIG_MAX_RETRIES\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.KENDRA_FAQ_CONFIG_RETRY_DELAY\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.KENDRA_FAQ_ES_FALLBACK\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.KENDRA_FAQ_INDEX\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.KENDRA_FAQ_INDEX.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.KENDRA_FAQ_INDEX\"}}},{\"name\":\"entireRequest._settings.MINIMUM_CONFIDENCE_SCORE\",\"type\":\"number\",\"esTypes\":[\"float\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.NO_VERIFIED_IDENTITY_QUESTION\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.NO_VERIFIED_IDENTITY_QUESTION.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.NO_VERIFIED_IDENTITY_QUESTION\"}}},{\"name\":\"entireRequest._settings.REDACTING_REGEX\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.REDACTING_REGEX.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.REDACTING_REGEX\"}}},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.SMS_HINT_REMINDER\"}}},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER_ENABLE\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER_INTERVAL_HRS\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER_INTERVAL_HRS.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._settings.SMS_HINT_REMINDER_INTERVAL_HRS\"}}},{\"name\":\"entireRequest._type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._type\"}}},{\"name\":\"entireRequest._userId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._userId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._userId\"}}},{\"name\":\"entireRequest._userInfo.FirstSeen\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._userInfo.FirstSeen.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._userInfo.FirstSeen\"}}},{\"name\":\"entireRequest._userInfo.InteractionCount\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._userInfo.LastSeen\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._userInfo.LastSeen.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._userInfo.LastSeen\"}}},{\"name\":\"entireRequest._userInfo.TimeSinceLastInteraction\",\"type\":\"number\",\"esTypes\":[\"float\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._userInfo.UserId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._userInfo.UserId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._userInfo.UserId\"}}},{\"name\":\"entireRequest._userInfo.isVerifiedIdentity\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._userInfo.isVerifiedIdentity.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest._userInfo.isVerifiedIdentity\"}}},{\"name\":\"entireRequest.kendraResultsCached\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.kendraResultsCached.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.kendraResultsCached\"}}},{\"name\":\"entireRequest.question\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.question.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.question\"}}},{\"name\":\"entireRequest.sentiment\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.sentiment.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.sentiment\"}}},{\"name\":\"entireRequest.session.qnabot_gotanswer\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest.session.qnabot_qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabot_qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.session.qnabot_qid\"}}},{\"name\":\"entireRequest.session.qnabotcontext.kendra.kendraIndexId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabotcontext.kendra.kendraIndexId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.session.qnabotcontext.kendra.kendraIndexId\"}}},{\"name\":\"entireRequest.session.qnabotcontext.kendra.kendraQueryId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabotcontext.kendra.kendraQueryId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.session.qnabotcontext.kendra.kendraQueryId\"}}},{\"name\":\"entireRequest.session.qnabotcontext.kendra.kendraResponsibleQid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabotcontext.kendra.kendraResponsibleQid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.session.qnabotcontext.kendra.kendraResponsibleQid\"}}},{\"name\":\"entireRequest.session.qnabotcontext.kendra.kendraResultId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabotcontext.kendra.kendraResultId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.session.qnabotcontext.kendra.kendraResultId\"}}},{\"name\":\"entireRequest.session.qnabotcontext.navigation.hasParent\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest.session.qnabotcontext.navigation.next\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabotcontext.navigation.next.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.session.qnabotcontext.navigation.next\"}}},{\"name\":\"entireRequest.session.qnabotcontext.previous.a\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabotcontext.previous.a.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.session.qnabotcontext.previous.a\"}}},{\"name\":\"entireRequest.session.qnabotcontext.previous.q\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabotcontext.previous.q.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.session.qnabotcontext.previous.q\"}}},{\"name\":\"entireRequest.session.qnabotcontext.previous.qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabotcontext.previous.qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireRequest.session.qnabotcontext.previous.qid\"}}},{\"name\":\"entireResponse._userInfo.FirstSeen\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse._userInfo.FirstSeen.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse._userInfo.FirstSeen\"}}},{\"name\":\"entireResponse._userInfo.InteractionCount\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse._userInfo.LastSeen\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse._userInfo.LastSeen.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse._userInfo.LastSeen\"}}},{\"name\":\"entireResponse._userInfo.TimeSinceLastInteraction\",\"type\":\"number\",\"esTypes\":[\"float\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse._userInfo.UserId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse._userInfo.UserId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse._userInfo.UserId\"}}},{\"name\":\"entireResponse._userInfo.isVerifiedIdentity\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse._userInfo.isVerifiedIdentity.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse._userInfo.isVerifiedIdentity\"}}},{\"name\":\"entireResponse.answerSource\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.answerSource.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.answerSource\"}}},{\"name\":\"entireResponse.card.send\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.card.text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.card.text\"}}},{\"name\":\"entireResponse.card.title\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.title.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.card.title\"}}},{\"name\":\"entireResponse.card.url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.url.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.card.url\"}}},{\"name\":\"entireResponse.got_hits\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.QueryId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.QueryId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.QueryId\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.Key\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.Key.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.Key\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.Value.TextWithHighlightsValue.Highlights.BeginOffset\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.Value.TextWithHighlightsValue.Highlights.EndOffset\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.Value.TextWithHighlightsValue.Highlights.TopAnswer\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.Value.TextWithHighlightsValue.Text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.Value.TextWithHighlightsValue.Text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.Value.TextWithHighlightsValue.Text\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.ValueType\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.ValueType.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.AdditionalAttributes.ValueType\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentAttributes.Key\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentAttributes.Key.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.DocumentAttributes.Key\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentAttributes.Value.StringValue\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentAttributes.Value.StringValue.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.DocumentAttributes.Value.StringValue\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentExcerpt.Highlights.BeginOffset\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentExcerpt.Highlights.EndOffset\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentExcerpt.Highlights.TopAnswer\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentExcerpt.Text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentExcerpt.Text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.DocumentExcerpt.Text\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.DocumentId\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentTitle.Highlights.BeginOffset\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentTitle.Highlights.EndOffset\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentTitle.Highlights.TopAnswer\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentTitle.Text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentTitle.Text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.DocumentTitle.Text\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentURI\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.DocumentURI.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.DocumentURI\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.Id\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.Id.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.Id\"}}},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.Type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.ResultItems.Type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.ResultItems.Type\"}}},{\"name\":\"entireResponse.kendraResultsCached.TotalNumberOfResults\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.kendraResultsCached.originalKendraIndexId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.kendraResultsCached.originalKendraIndexId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.kendraResultsCached.originalKendraIndexId\"}}},{\"name\":\"entireResponse.message\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.message.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.message\"}}},{\"name\":\"entireResponse.plainMessage\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.plainMessage.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.plainMessage\"}}},{\"name\":\"entireResponse.result.a\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.a.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.result.a\"}}},{\"name\":\"entireResponse.result.answersource\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.answersource.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.result.answersource\"}}},{\"name\":\"entireResponse.result.autotranslate.a\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.result.l\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.l.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.result.l\"}}},{\"name\":\"entireResponse.result.q\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.q.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.result.q\"}}},{\"name\":\"entireResponse.result.qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.result.qid\"}}},{\"name\":\"entireResponse.result.questions.q\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.questions.q.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.result.questions.q\"}}},{\"name\":\"entireResponse.result.quniqueterms\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.quniqueterms.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.result.quniqueterms\"}}},{\"name\":\"entireResponse.result.type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.result.type\"}}},{\"name\":\"entireResponse.session.appContext\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.appContext.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.session.appContext\"}}},{\"name\":\"entireResponse.session.qnabot_gotanswer\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.qnabot_gotanswer.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.session.qnabot_gotanswer\"}}},{\"name\":\"entireResponse.session.qnabot_qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.qnabot_qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.session.qnabot_qid\"}}},{\"name\":\"entireResponse.session.qnabotcontext\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.qnabotcontext.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.session.qnabotcontext\"}}},{\"name\":\"entireResponse.type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"entireResponse.type\"}}},{\"name\":\"qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"qid\"}}},{\"name\":\"topic\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"topic.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"topic\"}}},{\"name\":\"utterance\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"utterance.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"utterance\"}}}]", "timeFieldName": "datetime", - "title": "", - "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"esTypes\":[\"_type\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"answer\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"answer.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"answer\",\"subType\":\"multi\"},{\"name\":\"clientType\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"clientType.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"clientType\",\"subType\":\"multi\"},{\"name\":\"datetime\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._clientType\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._clientType.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._clientType\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.bot.alias\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.bot.alias.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.bot.alias\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.bot.name\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.bot.name.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.bot.name\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.bot.version\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.bot.version.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.bot.version\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.currentIntent.confirmationStatus\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.confirmationStatus.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.currentIntent.confirmationStatus\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.currentIntent.name\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.name.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.currentIntent.name\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.currentIntent.slotDetails.slot.originalValue\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.slotDetails.slot.originalValue.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.currentIntent.slotDetails.slot.originalValue\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.currentIntent.slotDetails.slot.resolutions.value\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.slotDetails.slot.resolutions.value.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.currentIntent.slotDetails.slot.resolutions.value\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.currentIntent.slots.slot\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.currentIntent.slots.slot.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.currentIntent.slots.slot\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.errorFound\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._event.inputTranscript\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.inputTranscript.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.inputTranscript\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.invocationSource\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.invocationSource.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.invocationSource\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.messageVersion\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.messageVersion.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.messageVersion\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.origQuestion\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.origQuestion.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.origQuestion\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.outputDialogMode\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.outputDialogMode.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.outputDialogMode\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.recentIntentSummaryView.confirmationStatus\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.confirmationStatus.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.recentIntentSummaryView.confirmationStatus\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.recentIntentSummaryView.dialogActionType\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.dialogActionType.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.recentIntentSummaryView.dialogActionType\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.recentIntentSummaryView.fulfillmentState\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.fulfillmentState.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.recentIntentSummaryView.fulfillmentState\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.recentIntentSummaryView.intentName\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.intentName.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.recentIntentSummaryView.intentName\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.recentIntentSummaryView.slots.slot\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.recentIntentSummaryView.slots.slot.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.recentIntentSummaryView.slots.slot\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.demo\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.demo.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.demo\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.elicitResponse\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.elicitResponse.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.elicitResponse\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.elicitResponseChainingConfig\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.elicitResponseChainingConfig.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.elicitResponseChainingConfig\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.elicitResponseNamespace\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.elicitResponseNamespace.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.elicitResponseNamespace\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.elicitResponseProgress\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.elicitResponseProgress.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.elicitResponseProgress\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.kendraIndexId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.kendraIndexId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.kendraIndexId\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.kendraQueryId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.kendraQueryId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.kendraQueryId\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.kendraResponsibleQid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.kendraResponsibleQid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.kendraResponsibleQid\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.kendraResultId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.kendraResultId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.kendraResultId\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.localTimeZone\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.localTimeZone.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.localTimeZone\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.navigation\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.navigation.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.navigation\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.previous\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.previous.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.previous\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_gotanswer\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_gotanswer.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.qnabot_gotanswer\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_nohits\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_nohits.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.qnabot_nohits\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.qnabot_qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.qnabot_qid\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.qnabotcontext\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.qnabotcontext.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.qnabotcontext\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.topic\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.topic.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.topic\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.undefined\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.undefined.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.undefined\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.userDetectedLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.userDetectedLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.userDetectedLocale\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.userDetectedLocaleConfidence\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.userDetectedLocaleConfidence.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.userDetectedLocaleConfidence\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.userDetectedSecondaryLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.userDetectedSecondaryLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.userDetectedSecondaryLocale\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.userLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.userLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.userLocale\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.sessionAttributes.userPreferredLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.sessionAttributes.userPreferredLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.sessionAttributes.userPreferredLocale\",\"subType\":\"multi\"},{\"name\":\"entireRequest._event.userId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._event.userId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._event.userId\",\"subType\":\"multi\"},{\"name\":\"entireRequest._info.es.address\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.address.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._info.es.address\",\"subType\":\"multi\"},{\"name\":\"entireRequest._info.es.index\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.index.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._info.es.index\",\"subType\":\"multi\"},{\"name\":\"entireRequest._info.es.service.proxy\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.service.proxy.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._info.es.service.proxy\",\"subType\":\"multi\"},{\"name\":\"entireRequest._info.es.service.qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.service.qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._info.es.service.qid\",\"subType\":\"multi\"},{\"name\":\"entireRequest._info.es.type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._info.es.type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._info.es.type\",\"subType\":\"multi\"},{\"name\":\"entireRequest._preferredResponseType\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._preferredResponseType.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._preferredResponseType\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ALT_SEARCH_KENDRA_INDEXES\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ALT_SEARCH_KENDRA_INDEXES.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ALT_SEARCH_KENDRA_INDEXES\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.DEFAULT_ALEXA_LAUNCH_MESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.DEFAULT_ALEXA_LAUNCH_MESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.DEFAULT_ALEXA_LAUNCH_MESSAGE\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.DEFAULT_ALEXA_STOP_MESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.DEFAULT_ALEXA_STOP_MESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.DEFAULT_ALEXA_STOP_MESSAGE\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.DEFAULT_USER_POOL_JWKS_URL\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.DEFAULT_USER_POOL_JWKS_URL.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.DEFAULT_USER_POOL_JWKS_URL\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_BOT_FAILURE_MESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_BOT_FAILURE_MESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ELICIT_RESPONSE_BOT_FAILURE_MESSAGE\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_DEFAULT_MSG\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_DEFAULT_MSG.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ELICIT_RESPONSE_DEFAULT_MSG\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_MAX_RETRIES\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_RETRY_MESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ELICIT_RESPONSE_RETRY_MESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ELICIT_RESPONSE_RETRY_MESSAGE\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.EMPTYMESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.EMPTYMESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.EMPTYMESSAGE\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ENABLE_DEBUG_RESPONSES\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ENABLE_DEBUG_RESPONSES.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ENABLE_DEBUG_RESPONSES\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ENABLE_MULTI_LANGUAGE_SUPPORT\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ENABLE_MULTI_LANGUAGE_SUPPORT.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ENABLE_MULTI_LANGUAGE_SUPPORT\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ENABLE_REDACTING\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ENABLE_REDACTING.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ENABLE_REDACTING\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ENABLE_SENTIMENT_SUPPORT\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.ERRORMESSAGE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ERRORMESSAGE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ERRORMESSAGE\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ES_KEYWORD_SYNTAX_TYPES\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_KEYWORD_SYNTAX_TYPES.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ES_KEYWORD_SYNTAX_TYPES\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ES_MINIMUM_SHOULD_MATCH\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_MINIMUM_SHOULD_MATCH.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ES_MINIMUM_SHOULD_MATCH\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ES_NO_HITS_QUESTION\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_NO_HITS_QUESTION.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ES_NO_HITS_QUESTION\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ES_PHRASE_BOOST\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_PHRASE_BOOST.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ES_PHRASE_BOOST\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ES_SCORE_ANSWER_FIELD\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_SCORE_ANSWER_FIELD.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ES_SCORE_ANSWER_FIELD\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ES_SYNTAX_CONFIDENCE_LIMIT\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_SYNTAX_CONFIDENCE_LIMIT.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ES_SYNTAX_CONFIDENCE_LIMIT\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ES_USE_FUZZY_MATCH\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_USE_FUZZY_MATCH.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ES_USE_FUZZY_MATCH\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.ES_USE_KEYWORD_FILTERS\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.ES_USE_KEYWORD_FILTERS.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.ES_USE_KEYWORD_FILTERS\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.MINIMUM_CONFIDENCE_SCORE\",\"type\":\"number\",\"esTypes\":[\"float\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._settings.REDACTING_REGEX\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.REDACTING_REGEX.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.REDACTING_REGEX\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.SMS_HINT_REMINDER\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER_ENABLE\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER_ENABLE.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.SMS_HINT_REMINDER_ENABLE\",\"subType\":\"multi\"},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER_INTERVAL_HRS\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._settings.SMS_HINT_REMINDER_INTERVAL_HRS.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._settings.SMS_HINT_REMINDER_INTERVAL_HRS\",\"subType\":\"multi\"},{\"name\":\"entireRequest._translation\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._translation.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._translation\",\"subType\":\"multi\"},{\"name\":\"entireRequest._type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._type\",\"subType\":\"multi\"},{\"name\":\"entireRequest._userId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._userId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._userId\",\"subType\":\"multi\"},{\"name\":\"entireRequest._userInfo.FirstSeen\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._userInfo.FirstSeen.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._userInfo.FirstSeen\",\"subType\":\"multi\"},{\"name\":\"entireRequest._userInfo.InteractionCount\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._userInfo.LastSeen\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._userInfo.LastSeen.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._userInfo.LastSeen\",\"subType\":\"multi\"},{\"name\":\"entireRequest._userInfo.TimeSinceLastInteraction\",\"type\":\"number\",\"esTypes\":[\"float\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest._userInfo.UserId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest._userInfo.UserId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest._userInfo.UserId\",\"subType\":\"multi\"},{\"name\":\"entireRequest.question\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.question.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.question\",\"subType\":\"multi\"},{\"name\":\"entireRequest.sentiment\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.sentiment.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.sentiment\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.demo.age.Age\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.demo.age.Age.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.demo.age.Age\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.demo.comment.FreeText\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.demo.comment.FreeText.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.demo.comment.FreeText\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.demo.comment.Sentiment\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.demo.comment.Sentiment.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.demo.comment.Sentiment\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.demo.name.FirstName\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.demo.name.FirstName.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.demo.name.FirstName\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.demo.name.LastName\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.demo.name.LastName.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.demo.name.LastName\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.elicitResponse\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.elicitResponse.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.elicitResponse\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.elicitResponseChainingConfig\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.elicitResponseChainingConfig.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.elicitResponseChainingConfig\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.elicitResponseNamespace\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.elicitResponseNamespace.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.elicitResponseNamespace\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.elicitResponseProgress\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.elicitResponseProgress.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.elicitResponseProgress\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.kendraIndexId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.kendraIndexId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.kendraIndexId\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.kendraQueryId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.kendraQueryId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.kendraQueryId\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.kendraResponsibleQid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.kendraResponsibleQid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.kendraResponsibleQid\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.kendraResultId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.kendraResultId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.kendraResultId\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.localTimeZone\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.localTimeZone.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.localTimeZone\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.navigation.hasParent\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest.session.navigation.next\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.navigation.next.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.navigation.next\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.navigation.previous\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.navigation.previous.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.navigation.previous\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.previous.a\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.previous.a.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.previous.a\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.previous.alt.markdown\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.previous.alt.markdown.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.previous.alt.markdown\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.previous.alt.ssml\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.previous.alt.ssml.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.previous.alt.ssml\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.previous.q\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.previous.q.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.previous.q\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.previous.qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.previous.qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.previous.qid\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.qnabot_gotanswer\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest.session.qnabot_nohits\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest.session.qnabot_qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.qnabot_qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.qnabot_qid\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.topic\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.topic.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.topic\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.userDetectedLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.userDetectedLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.userDetectedLocale\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.userDetectedLocaleConfidence\",\"type\":\"number\",\"esTypes\":[\"float\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireRequest.session.userDetectedSecondaryLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.userDetectedSecondaryLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.userDetectedSecondaryLocale\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.userLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.userLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.userLocale\",\"subType\":\"multi\"},{\"name\":\"entireRequest.session.userPreferredLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireRequest.session.userPreferredLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireRequest.session.userPreferredLocale\",\"subType\":\"multi\"},{\"name\":\"entireResponse._userInfo.FirstSeen\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse._userInfo.FirstSeen.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse._userInfo.FirstSeen\",\"subType\":\"multi\"},{\"name\":\"entireResponse._userInfo.InteractionCount\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse._userInfo.LastSeen\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse._userInfo.LastSeen.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse._userInfo.LastSeen\",\"subType\":\"multi\"},{\"name\":\"entireResponse._userInfo.TimeSinceLastInteraction\",\"type\":\"number\",\"esTypes\":[\"float\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse._userInfo.UserId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse._userInfo.UserId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse._userInfo.UserId\",\"subType\":\"multi\"},{\"name\":\"entireResponse.card.buttons.text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.buttons.text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.card.buttons.text\",\"subType\":\"multi\"},{\"name\":\"entireResponse.card.buttons.value\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.buttons.value.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.card.buttons.value\",\"subType\":\"multi\"},{\"name\":\"entireResponse.card.imageUrl\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.imageUrl.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.card.imageUrl\",\"subType\":\"multi\"},{\"name\":\"entireResponse.card.send\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.card.subTitle\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.subTitle.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.card.subTitle\",\"subType\":\"multi\"},{\"name\":\"entireResponse.card.text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.card.text\",\"subType\":\"multi\"},{\"name\":\"entireResponse.card.title\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.title.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.card.title\",\"subType\":\"multi\"},{\"name\":\"entireResponse.card.url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.card.url.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.card.url\",\"subType\":\"multi\"},{\"name\":\"entireResponse.got_hits\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.message\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.message.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.message\",\"subType\":\"multi\"},{\"name\":\"entireResponse.plainMessage\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.plainMessage.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.plainMessage\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.a\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.a.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.a\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.alt.markdown\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.alt.markdown.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.alt.markdown\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.alt.ssml\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.alt.ssml.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.alt.ssml\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.args\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.args.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.args\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.autotranslate.a\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.result.autotranslate.alt.markdown\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.result.autotranslate.alt.ssml\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.result.autotranslate.r.buttons.x.text\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.result.autotranslate.r.buttons.x.value\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.result.autotranslate.r.title\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.result.conditionalChaining\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.conditionalChaining.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.conditionalChaining\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.elicitResponse.response_sessionattr_namespace\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.elicitResponse.response_sessionattr_namespace.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.elicitResponse.response_sessionattr_namespace\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.elicitResponse.responsebot_hook\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.elicitResponse.responsebot_hook.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.elicitResponse.responsebot_hook\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.l\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.l.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.l\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.next\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.next.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.next\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.qid\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.questions.q\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.questions.q.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.questions.q\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.quniqueterms\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.quniqueterms.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.quniqueterms\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.r.buttons.text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.r.buttons.text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.r.buttons.text\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.r.buttons.value\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.r.buttons.value.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.r.buttons.value\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.r.imageUrl\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.r.imageUrl.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.r.imageUrl\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.r.subTitle\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.r.subTitle.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.r.subTitle\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.r.text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.r.text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.r.text\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.r.title\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.r.title.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.r.title\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.r.url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.r.url.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.r.url\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.selected\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"entireResponse.result.t\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.t.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.t\",\"subType\":\"multi\"},{\"name\":\"entireResponse.result.type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.result.type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.result.type\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.appContext\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.appContext.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.appContext\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.demo\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.demo.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.demo\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.elicitResponse\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.elicitResponse.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.elicitResponse\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.elicitResponseChainingConfig\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.elicitResponseChainingConfig.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.elicitResponseChainingConfig\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.elicitResponseLoopCount\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.elicitResponseLoopCount.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.elicitResponseLoopCount\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.elicitResponseNamespace\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.elicitResponseNamespace.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.elicitResponseNamespace\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.elicitResponseProgress\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.elicitResponseProgress.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.elicitResponseProgress\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.kendraIndexId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.kendraIndexId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.kendraIndexId\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.kendraQueryId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.kendraQueryId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.kendraQueryId\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.kendraResponsibleQid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.kendraResponsibleQid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.kendraResponsibleQid\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.kendraResultId\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.kendraResultId.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.kendraResultId\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.localTimeZone\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.localTimeZone.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.localTimeZone\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.navigation\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.navigation.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.navigation\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.previous\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.previous.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.previous\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.qnabot_gotanswer\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.qnabot_gotanswer.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.qnabot_gotanswer\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.qnabot_nohits\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.qnabot_nohits.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.qnabot_nohits\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.qnabot_qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.qnabot_qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.qnabot_qid\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.qnabotcontext\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.qnabotcontext.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.qnabotcontext\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.topic\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.topic.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.topic\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.undefined\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.undefined.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.undefined\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.userDetectedLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.userDetectedLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.userDetectedLocale\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.userDetectedLocaleConfidence\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.userDetectedLocaleConfidence.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.userDetectedLocaleConfidence\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.userDetectedSecondaryLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.userDetectedSecondaryLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.userDetectedSecondaryLocale\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.userLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.userLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.userLocale\",\"subType\":\"multi\"},{\"name\":\"entireResponse.session.userPreferredLocale\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.session.userPreferredLocale.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.session.userPreferredLocale\",\"subType\":\"multi\"},{\"name\":\"entireResponse.type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"entireResponse.type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"entireResponse.type\",\"subType\":\"multi\"},{\"name\":\"qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"qid\",\"subType\":\"multi\"},{\"name\":\"topic\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"topic.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"topic\",\"subType\":\"multi\"},{\"name\":\"utterance\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"utterance.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"utterance\",\"subType\":\"multi\"}]" + "title": "" }, "references": [], "migrationVersion": { - "index-pattern": "6.5.0" + "index-pattern": "7.6.0" } }, { "id": "Feedback", "type": "index-pattern", - "updated_at": "2020-06-10T19:31:58.053Z", - "version": "WzksMV0=", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzMxLDFd", "attributes": { + "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"esTypes\":[\"_type\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"alternate\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"alternate.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"alternate\"}}},{\"name\":\"answer\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"answer.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"answer\"}}},{\"name\":\"datetime\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"feedback\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"feedback.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"feedback\"}}},{\"name\":\"qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"qid\"}}},{\"name\":\"utterance\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"utterance.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"utterance\"}}}]", "timeFieldName": "datetime", - "title": "", - "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"esTypes\":[\"_type\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"alternate\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"alternate.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"alternate\",\"subType\":\"multi\"},{\"name\":\"answer\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"answer.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"answer\",\"subType\":\"multi\"},{\"name\":\"datetime\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"feedback\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"feedback.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"feedback\",\"subType\":\"multi\"},{\"name\":\"qid\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"qid.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"qid\",\"subType\":\"multi\"},{\"name\":\"utterance\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"utterance.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"utterance\",\"subType\":\"multi\"}]" + "title": "" }, "references": [], "migrationVersion": { - "index-pattern": "6.5.0" + "index-pattern": "7.6.0" } }, { "id": "QnaItems", "type": "index-pattern", - "updated_at": "2020-06-10T19:31:58.053Z", - "version": "WzEwLDFd", + "updated_at": "2020-08-21T23:30:32.252Z", + "version": "WzM0LDFd", "attributes": { - "title": "", - "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"esTypes\":[\"_type\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"a\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"alt.markdown\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"alt.markdown.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"alt.markdown\",\"subType\":\"multi\"},{\"name\":\"alt.ssml\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"alt.ssml.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"alt.ssml\",\"subType\":\"multi\"},{\"name\":\"args\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"args.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"args\",\"subType\":\"multi\"},{\"name\":\"conditionalChaining\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"conditionalChaining.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"conditionalChaining\",\"subType\":\"multi\"},{\"name\":\"correctAnswers\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"elicitResponse.response_sessionattr_namespace\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"elicitResponse.response_sessionattr_namespace.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"elicitResponse.response_sessionattr_namespace\",\"subType\":\"multi\"},{\"name\":\"elicitResponse.responsebot_hook\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"elicitResponse.responsebot_hook.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"elicitResponse.responsebot_hook\",\"subType\":\"multi\"},{\"name\":\"incorrectAnswers\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"l\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"next\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"next.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"next\",\"subType\":\"multi\"},{\"name\":\"qid\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"question\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"questions.q\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"quiz\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"quiz.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"quiz\",\"subType\":\"multi\"},{\"name\":\"quniqueterms\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.buttons.text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.buttons.text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"r.buttons.text\",\"subType\":\"multi\"},{\"name\":\"r.buttons.value\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.buttons.value.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"r.buttons.value\",\"subType\":\"multi\"},{\"name\":\"r.imageUrl\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"r.subTitle\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.subTitle.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"r.subTitle\",\"subType\":\"multi\"},{\"name\":\"r.text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"r.text\",\"subType\":\"multi\"},{\"name\":\"r.title\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.url.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"r.url\",\"subType\":\"multi\"},{\"name\":\"responses.correct\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"responses.correct.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"responses.correct\",\"subType\":\"multi\"},{\"name\":\"responses.end\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"responses.end.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"responses.end\",\"subType\":\"multi\"},{\"name\":\"responses.incorrect\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"responses.incorrect.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"responses.incorrect\",\"subType\":\"multi\"},{\"name\":\"selected\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"t\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"parent\":\"type\",\"subType\":\"multi\"}]" + "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"esTypes\":[\"_type\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"a\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"alt.markdown\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"alt.markdown.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"alt.markdown\"}}},{\"name\":\"alt.ssml\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"alt.ssml.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"alt.ssml\"}}},{\"name\":\"args\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"args.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"args\"}}},{\"name\":\"conditionalChaining\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"conditionalChaining.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"conditionalChaining\"}}},{\"name\":\"correctAnswers\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"elicitResponse.response_sessionattr_namespace\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"elicitResponse.response_sessionattr_namespace.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"elicitResponse.response_sessionattr_namespace\"}}},{\"name\":\"elicitResponse.responsebot_hook\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"elicitResponse.responsebot_hook.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"elicitResponse.responsebot_hook\"}}},{\"name\":\"incorrectAnswers\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"l\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"next\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"next.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"next\"}}},{\"name\":\"qid\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"question\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"questions.q\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"quiz\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"quiz.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"quiz\"}}},{\"name\":\"quniqueterms\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.buttons.text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.buttons.text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"r.buttons.text\"}}},{\"name\":\"r.buttons.value\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.buttons.value.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"r.buttons.value\"}}},{\"name\":\"r.imageUrl\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"r.subTitle\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.subTitle.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"r.subTitle\"}}},{\"name\":\"r.text\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.text.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"r.text\"}}},{\"name\":\"r.title\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"r.url.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"r.url\"}}},{\"name\":\"responses.correct\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"responses.correct.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"responses.correct\"}}},{\"name\":\"responses.end\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"responses.end.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"responses.end\"}}},{\"name\":\"responses.incorrect\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"responses.incorrect.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"responses.incorrect\"}}},{\"name\":\"selected\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"t\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"type.keyword\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"type\"}}}]", + "title": "" }, "references": [], "migrationVersion": { - "index-pattern": "6.5.0" + "index-pattern": "7.6.0" } } ] diff --git a/templates/master/exportstack.js b/templates/master/exportstack.js index a0bd0a79d..18f5691db 100644 --- a/templates/master/exportstack.js +++ b/templates/master/exportstack.js @@ -12,6 +12,8 @@ module.exports={ "EsEndpoint": {"Fn::GetAtt": ["ESVar", "ESAddress"]}, "EsProxyLambda": {"Fn::GetAtt":["ESProxyLambda","Arn"]}, "ExportBucket": {"Ref":"ExportBucket"}, + "DefaultQnABotSettings":{"Ref":"DefaultQnABotSettings"}, + "CustomQnABotSettings":{"Ref":"CustomQnABotSettings"}, } } } diff --git a/templates/master/index.js b/templates/master/index.js index ab012c721..caac154a8 100644 --- a/templates/master/index.js +++ b/templates/master/index.js @@ -182,7 +182,7 @@ module.exports={ "Domain":{"Fn::Not":[{"Fn::Equals":[{"Ref":"ApprovedDomain"},"NONE"]}]}, "BuildExamples":{"Fn::Equals":[{"Ref":"BuildExamples"},"TRUE"]}, "CreateDomain":{"Fn::Equals":[{"Ref":"ElasticsearchName"},"EMPTY"]}, - "DontCreateDomain":{"Fn::Not":[{"Fn::Equals":[{"Ref":"ElasticsearchName"},"EMPTY"]}]} + "DontCreateDomain":{"Fn::Not":[{"Fn::Equals":[{"Ref":"ElasticsearchName"},"EMPTY"]}]}, } } diff --git a/templates/master/lex-build/index.js b/templates/master/lex-build/index.js index 0c7683219..9cf0f946f 100644 --- a/templates/master/lex-build/index.js +++ b/templates/master/lex-build/index.js @@ -100,7 +100,7 @@ module.exports={ "Path": "/", "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", - {"Ref":"EsPolicy"}, + {"Ref":"QueryPolicy"}, "arn:aws:iam::aws:policy/AmazonLexFullAccess" ] } diff --git a/templates/master/lex/fulfillment.js b/templates/master/lex/fulfillment.js index 90023abe6..a7372b77a 100644 --- a/templates/master/lex/fulfillment.js +++ b/templates/master/lex/fulfillment.js @@ -128,7 +128,7 @@ module.exports = { "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", "arn:aws:iam::aws:policy/TranslateReadOnly", "arn:aws:iam::aws:policy/ComprehendReadOnly", - { "Ref": "EsPolicy" } + { "Ref": "QueryPolicy" } ], "Policies": [ { diff --git a/templates/master/proxy-es.js b/templates/master/proxy-es.js index 221a3ed65..4d5b8063c 100644 --- a/templates/master/proxy-es.js +++ b/templates/master/proxy-es.js @@ -206,7 +206,7 @@ module.exports={ "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", "arn:aws:iam::aws:policy/TranslateReadOnly", - {"Ref":"EsPolicy"}, + {"Ref":"QueryPolicy"}, "arn:aws:iam::aws:policy/AmazonLexFullAccess" ], "Policies": [ @@ -287,7 +287,7 @@ module.exports={ ] } }, - "EsPolicy": { + "QueryPolicy": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "PolicyDocument": { @@ -299,8 +299,15 @@ module.exports={ "es:*" ], "Resource":["*"] - }, - { + },{ + "Effect": "Allow", + "Action": [ + "kendra:Query" + ], + "Resource":[ + {"Fn::Sub":"arn:aws:kendra:${AWS::Region}:${AWS::AccountId}:index/*"}, + ] + },{ "Effect": "Allow", "Action": ["s3:Get*"], "Resource":[ diff --git a/templates/master/routes/jobs/export-start.vm b/templates/master/routes/jobs/export-start.vm index eb9c82663..e95d9d4cb 100644 --- a/templates/master/routes/jobs/export-start.vm +++ b/templates/master/routes/jobs/export-start.vm @@ -6,8 +6,7 @@ "id":"$input.params('proxy')", "config":"status/$input.params('proxy')", "tmp":"tmp/$input.params('proxy')", - "key":"data/$input.params('proxy')", + "key":"$inputRoot.get('prefix')data/$input.params('proxy')", "filter":"$inputRoot.get('filter')", "status":"Started" -} - +} \ No newline at end of file diff --git a/templates/master/schemaLambda.js b/templates/master/schemaLambda.js index fbcacde0e..9bab5860d 100644 --- a/templates/master/schemaLambda.js +++ b/templates/master/schemaLambda.js @@ -47,7 +47,7 @@ module.exports={ "Path": "/", "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", - {"Ref":"EsPolicy"} + {"Ref":"QueryPolicy"} ] } } diff --git a/templates/master/var.js b/templates/master/var.js index 972b7997e..e709d8b5d 100644 --- a/templates/master/var.js +++ b/templates/master/var.js @@ -51,7 +51,7 @@ module.exports={ "CreateDomain", {"Ref":"ElasticsearchDomain"}, {"Ref":"ElasticsearchName"} - ]}, + ]} } }, "ApiUrl":{ diff --git a/website/js/components/designer/index.vue b/website/js/components/designer/index.vue index d3cc6047f..7a5f615a9 100644 --- a/website/js/components/designer/index.vue +++ b/website/js/components/designer/index.vue @@ -20,6 +20,8 @@ alexa v-list-tile build + v-list-tile + sync span questions(@filter="get(pagination)" v-if="active==='questions'") test(v-if="active==='test'") @@ -146,6 +148,7 @@ module.exports={ edit:require('./edit.vue').default, build:require('./rebuild.vue').default, alexa:require('./alexa.vue').default, + sync:require('./synckendra.vue').default }, computed:{ empty:function(){ diff --git a/website/js/components/designer/menu-test.vue b/website/js/components/designer/menu-test.vue index 6be405e1c..d55d1cf6a 100644 --- a/website/js/components/designer/menu-test.vue +++ b/website/js/components/designer/menu-test.vue @@ -57,7 +57,7 @@ module.exports={ simulate:_.debounce(function(){ return this.$store.dispatch('data/search',{ query:this.query, - topic:this.topic + topic:this.topic, }) },500,{trailing:false,leading:true}) } diff --git a/website/js/components/designer/synckendra.vue b/website/js/components/designer/synckendra.vue new file mode 100644 index 000000000..41ad8147d --- /dev/null +++ b/website/js/components/designer/synckendra.vue @@ -0,0 +1,134 @@ + + + + + + diff --git a/website/js/components/export.vue b/website/js/components/export.vue index 0c7b11cb0..cbf947299 100644 --- a/website/js/components/export.vue +++ b/website/js/components/export.vue @@ -91,8 +91,8 @@ module.exports={ var status=await self.$store.dispatch('api/getExport',job) Object.assign(out,coll[index],status) console.log(status.status) - if(status.status!=="Completed" && status.status!=="Error"){ - setTimeout(()=>poll(),1000) + if(status.status!=="Completed" && status.status!=="Error" && status.status!='Sync Complete'){ + setTimeout(()=>poll(),1000) } } }) @@ -106,7 +106,7 @@ module.exports={ }) await this.refresh() }catch(e){ - this.error=err + this.error=e }finally{ } }, diff --git a/website/js/lib/store/api/actions/export.js b/website/js/lib/store/api/actions/export.js index 045ef6d41..f10a5e871 100644 --- a/website/js/lib/store/api/actions/export.js +++ b/website/js/lib/store/api/actions/export.js @@ -39,7 +39,20 @@ module.exports={ var result=await context.dispatch('_request',{ url:`${info._links.exports.href}/${opts.name}`, method:'put', - body:opts.filter ? {filter:`${opts.filter}.*`} : {} + body:opts.filter ? {filter:`${opts.filter}.*`, prefix:''} : {prefix:''} + }) + }, + startKendraSyncExport:async function(context,opts){ + console.log("Entering startKendraSyncExport function"); + var info=await context.dispatch('_request',{ + url:context.rootState.info._links.jobs.href, + method:'get' + }) + + var result=await context.dispatch('_request',{ + url:`${info._links.exports.href}/${opts.name}`, + method:'put', + body:opts.filter ? {filter:`${opts.filter}.*`, prefix:'kendra-'} : {prefix:'kendra-'} }) }, downloadExport:async function(context,opts){ @@ -93,7 +106,14 @@ module.exports={ method:'get' }) }, + getExportByJobId(context,id){ + return context.dispatch('_request',{ + url:context.rootState.info._links.jobs.href + '/exports/' + id, + method:'get' + }) + }, deleteExport(context,opts){ + console.log(`delete export opts: ${JSON.stringify(opts, null, 2)}`); return context.dispatch('_request',{ url:opts.href, method:'delete' diff --git a/workshops/kendra/README.md b/workshops/kendra/README.md new file mode 100644 index 000000000..4c85d03cb --- /dev/null +++ b/workshops/kendra/README.md @@ -0,0 +1,245 @@ +# Kendra Integration + +There are 2 use cases of the Kendra integration. This tutorial covers both parts. The first uses Kendra's FAQ model to improve QnABot's understanding of human language and find better matches to questions. The second covers the Kendra Fallback engine which performs searches over documents in Kendra to extract answers for unanticipated questions. + +## Section 1: Kendra FAQ + +### Economics class example + +QnABot now offers a new machine-learning based query method based on Amazon Kendra to improve question-matching accuracies and reduce the tuning workload. Let's try a simple example to illustrate the concept: + +#### Part 1: See the limitations of ElasticSearch + +Open the QnABot designer console. You can find the link to the 'ContentDesignerURL' under the Outputs tab of the launched CloudFormation template. If you do not know your login, you should have received an email once the template finished creating with a temporary password. The default username is 'Admin'. + + + +1. Add the following question to your designer console: + + QID: *econ.1* + + Question: *What are the main goals of an economy?* + + Answer: *All economies in the world try to achieve 3 things: Growth, High employment* + + + +2. Open QnABot client and enter the question "What are the main goals of an economy?" + + + + + +3. Then, try out a different phrasing: *What main objectives do economies try to achieve?* + +You'll find that the ElasticSearch based QnABot does not know that these two questions mean the same thing. We're going to see how Amazon Kendra can address this limitation. + +#### Part 2: Create an Amazon Kendra index + +1. Go to [Amazon Kendra](http://console.aws.amazon.com/kendra) and click on **Create Index** in the top right corner. +2. Provide an *Index name* like *explore-qnabot* and optional *Description*. +3. Choose the recommended *Create a new role* for the IAM role and provide a name like *qnabot-idx-role*. + + + +4. Press **Next**. Decide if you want the Enterprise or Developer edition. + + Kendra's Free Tier of usage provides the Developer edition for free usage of up to 750 hours for the first 30 days. Both editions have a query rate that is strictly enforced at 0.5 queries/second. The Enterprise edition provides the option to increase this limit for additional cost. The Developer edition cannot increase query capacity. For more information on pricing details, go to [https://aws.amazon.com/kendra/pricing/](https://aws.amazon.com/kendra/pricing/). + +5. **Create** the index and wait for it to become active. **Note that this takes about ~30 minutes to complete. You will NOT be able to move forward in the tutorial before this index has finished creating.** + + +#### Part 3: Set up KendraFAQ in the designer console + +1. Log in to the Content Designer, and go to settings. Scroll down until you see the field *KENDRA_FAQ_INDEX*. + + + +2. Enter your Kendra index ID copied from the Kendra console. + + + +
+ + + +3. Save the settings and return to the home page of the web interface. +4. Choose the top right edit card menu (⋮) to open up a drop-down menu. Press **Sync Kendra FAQ**. + + + +5. Wait until your designer console finishes syncing to the Kendra index. **This may take a couple minutes.** +6. When it shows the *Sync Complete* status, you can go to your QnABot index in the Kendra console and check the FAQs tab to see a newly created (or updated) `qna-facts` FAQ. You will need to sync your questions to a Kendra FAQ each time you update the content in your designer console. +7. Go back into the QnABot client and try out the new phrasing again: "What main objectives do economies try to achieve?" + +You'll see that with Kendra-based question matching, the QnABot can understand variations in human language better! Amazon Kendra is an enterprise search service powered by machine learning and natural language processing. This means that it can apply different semantic meanings over the terms in a user’s question to better understand the meaning of complex human language, and identify better answers. With Amazon Kendra, QnABot is able to comprehend that these two question phrasings mean the same thing. + + +### Supported features +QnABot supports the following features with its Amazon Kendra alternative implementation. + +|Feature | Supported | +|---------------------------------------------------------|-------------------------------------------------------------------------| +|Adding images to answer | YES | +|Using SSML to control speech synthesis | YES | +|Adding Markdown to style rich text answers on web UI | YES | +|Using variables and conditional content, with Handlebars | YES | +|Displaying buttons on the web UI | YES | +|Using Topics to support follow-up questions | NO. Supported only on ElasticSearch | +|Adding style to QnABot | YES | +|Extending QnABot with lambda hook functions | YES | +|Keyword filters and custom "Don't know" answers | Supported via optional ElasticSearch Fallback | +|Tuning, testing, and troubleshooting | YES | +|Exporting and importing answers | YES | +|Modifying configuration settings | YES | +|Document serach with Amazon Kendra as a fallback engine | YES | +|Supporting multiple languages | YES | +|Configuring QnABot to ask the questions | YES | +|Automatically advancing along a tree of questions | YES | +|Using QnABot in a call center or with SMS text messaging | YES | +|FuzzyMatching (spelling errors) | NO. Supported only on ElasticSearch | +|QID querying | NO. Supported only on ElasticSearch | + + +### QnABot Answer Sources +There are four unique sources that supply answers to QnABot. +- **ElasticSearch**: The first method is the standard ElasticSearch implementation. If the `KENDRA_FAQ_INDEX` is not enabled or if a feature is only supported on ElasticSearch, then QnABot will default to this query method. +- **KendraFAQ**: Then there is the KendraFAQ method. If the custom parameter `KENDRA_FAQ_INDEX` is set and if that query is supported through the Kendra integration, then QnABot relies on Amazon Kendra's natural language and deep learning models to understand and match a question to an answer. This section walked through setting up this KendraFAQ model. +- **ElasticSearch Fallback**: If a question does not find any matches through the KendraFAQ method, this integration provides an optional ElasticSearch Fallback which is enabled by default in settings (`KENDRA_FAQ_ES_FALLBACK`). +- **Kendra Fallback**: Finally, if no matches are found to a curated question, then QnABot has the ability to search through documents uploaded to a Kendra index via the Kendra Fallback engine. This extension must first be loaded in and then enabled through the `ALT_SEARCH_KENDRA_INDEXES` setting. Part 2 below covers how to launch this mode. + +Turning on the `ENABLE_DEBUG_RESPONSES` parameter in settings will allow you to see which source generated a QnABot response. + + +### Limitations of the Kendra FAQ integration +The Kendra integration is currently a Beta feature for you to try. As the Kendra service develops frameworks to support similar use cases, its capabilities will continue changing. For this reason, here we document the limitations and current functions here. + +**Query Throttling Rates** + +- Kendra by default throttles queries to a rate of 1 query every 2 seconds on average. If there are many simultaneous users on QnABot at a time, expect there to be significant latency or even failure to execute Kendra queries. The current implementation is optimized to support 10 concurrent users where each user will wait a maximum of 4.5 seconds before receiving a response to their question. +- The Kendra Enterprise indices allow you to purchase addition query units to increase the throughput to support higher numbers of concurrent users. For additional information on adjusting query capacity, see [https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html](https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html). +- To optimize your QnABot for different numbers of users or use cases, see the fields `KENDRA_FAQ_MAX_RETRIES` and `KENDRA_FAQ_CONFIG_RETRY_DELAY`. They deal with Kendra's in-built exponential delay and retry function in the case that a query times out or is blocked due to too many other simultaneous queries. The first setting sets the maximum number of retries, and the second sets the base number of milliseconds that Kendra delays before retrying a query. + +**One-word Questions, Topics, QID Querying** +- Kendra FAQ currently does not find matches to single word questions, such as 'help' or 'hello'. QnABot falls back to using ElasticSearch to answer these questions. +- Kendra does not currently support follow-up questions using Topics. QnABot defaults to using ElasticSearch to identify an answer when a topic is defined. + +### Additional Question-Matching Examples +These are addional example questions where the new phrasing fails to find a match using ElasticSearch, but succeeds with the Kendra integration. + +QID: *solar.1* +- Question: *How old is the sun?* +- Answer: *Our sun is 4.6 billion years old.* +- New phrasing: *What is the age of the sun?* + +QID: bus.1 +- Question: *What are the main functions of management?* +- Answer: *There are 4 main functions of management: planning, organizing, directing, and controlling.* +- New phrasing: *What main operations does management fulfill?* + + + +## Section 2: Kendra Fallback Search + +### Solar-facts example + +QnABot now offers a new machine-learning based query method based on Amazon Kendra to improve question-matching accuracies and reduce the tuning workload. Let's try a simple example to illustrate the concept: + +#### Part 1: See the limitations of FAQ question-matching +What if you want to ask the QnABot a question that is not present in the FAQs but may be in related documents? This feature enables Kendra to perform a search on any uploaded content (e.g., PDFs, PowerPoint presentations, etc.) and retrieve those results in QnABot. + +#### Part 2: Add content to a Kendra index +1. **THIS ASSUMES YOU HAVE COMPLETED PART 2 OF SECTION 1 (Create an Amazon Kendra index). If not, go back and complete those steps.** +2. Create an S3 bucket and allow objects to be public read. + + a. In the S3 console, click on **Create bucket** and entire a *Bucket name* such as qnabot-docs. Press **Next** until you get to *Set permissions* (Step 3). + + +
+ + + b. **Uncheck** the box which states *Block all public access* and then mark the checkbox to acknowledge the statement. + + + + c. Press **Next** until you **Create** the bucket. + + d. **Upload** these PDFs into your new S3 bucket. Ensure that the objects are public read. + + - [solar_mysteries_book.pdf](./solar_mysteries_book.pdf) + + - [sun_lithograph.pdf](./sun_lithograph.pdf) + + + +3. Go to the Kendra console and select your index. Click on the **Step 2. Add data sources** button and select the Amazon S3 Connector. + + + +4. Name your data source (e.g., *qnabot-content*) and press **Next**. +5. Browse for your S3 bucket to enter its location. +6. Choose the recommended *Create new role* for the IAM role and provide a name like *kendra-s3-qnabot-access*. + + + +7. You can choose how freqeuntly to sync this data source with the Kendra index. If you will be updating content frequently, perhaps select a periodic option. Else, go with our *Run on demand* default. + + + +8. **Create** the data source. **This may take a couple minutes.** +9. Once the data source has been created, press on **Sync now** to sync the uploaded materials into the Kendra index. **This will take ~30 minutes**. + + + + +#### Part 3: Set up KendraFallback in Designer Console + +1. Log in to the Content Designer, and go to settings. Scroll down until you see the field *ALT_SEARCH_KENDRA_INDEXES*. +2. Enter your Kendra index ID copied from the Kendra console. You can provide a list of Kendra indices if you have data sources in multiple Kendra locations. If you have multiple, make sure to list them in an array of strings like this: ```["a672e3a2-nnnn-nnnn-do-not-copy", "4a0266cb-7760-do-not-copy"]``` + + + +3. Save the settings and return to the home page of the web interface. +4. Go to the **Import** tool from the designer console and open the drop down Examples/Extensions menu. + + + +5. Load the KendraFallback extension and wait for it to complete. Return to the home page of the designer console. This loads a new question with a QID of "KendraFallback". + + + +6. Edit this question in the Designer and change its question text from "no_hits_alternative" to your current ES_NO_HITS_QUESTION (most likely it will be "no_hits") and save the changes. You can find this phrase in your settings parameters. +7. If you have previously loaded the QnAUtility.json from Examples/Extensions you need to either remove the question with the ID "CustomNoMatches" or change the question for this ID from your current ES_NO_HITS_QUESTION (e.g. "no_hits") to "no_hits_alt". + + + + Once the new question, "KendraFallback" is configured as the response for "no_hits", the Kendra index will be searched for an answer whenever a curated answer can not be found. Once setup, Kendra provides a fallback mechanism prior to telling the user an answer could not be found. + +8. Go back into the QnABot client and try out some questions about the sun! + +### Example questions +There are a couple different types of responses from the KendraFallback engine. + +#### Top answer +For some queries, Kendra is able to find an answer in the uploaded documents with a very high confidence and yields a 'top answer' phrase. QnABot takes the Kendra results and shortens its response to only contain this phrase and the source link. + +For example, ask QnABot *When did Galileo first see sunspots?* or *How many regions does the sun have?* and take a look at the concise response returned. + +If you are interacting through a voice channel (such as an Echo or via the microphone on the bottom right of the web interface), QnABot will speak this shortened answer instead of the full text extract that it was retrieved from. + +#### Most relevant phrases with document search +In other cases, QnABot is able to find a text excerpt that most closely answers the question and it highlights the most relevant phrases of this response. This is returned along with other top results and their source links, enabling QnABot to act like a search engine over the uploaded documents. + +Try asking *What is the composition of the sun?* to see how QnABot selectively highlights the most important elements of a text extract. + +If a highly relevant phrase is identified, then this selective emphasis also applies to the voice response, which will read out the first 2 sentences of the most important highlighted text to provide context to the answer. + +#### For more question suggestions, try: +- What is a solar flare? +- How many Earth's could fit inside the sun? +- What are Earth's atmosphere layers? +- Who makes the first Earth-centered model of the solar system? +- Define solar wind + +You'll notice that that your designer console list has no curated answers for these questions. Instead of saying sadly we could not answer the question, Amazon Kendra is searched and possible answers or discovered text are returned. The links are clickable as well, so if the document is available to be read, it can be downloaded from the S3 bucket. + diff --git a/workshops/kendra/cftemplate_designer_url.png b/workshops/kendra/cftemplate_designer_url.png new file mode 100644 index 000000000..5f1e0c129 Binary files /dev/null and b/workshops/kendra/cftemplate_designer_url.png differ diff --git a/workshops/kendra/create_kendra_idx_opts.png b/workshops/kendra/create_kendra_idx_opts.png new file mode 100644 index 000000000..edf65dd31 Binary files /dev/null and b/workshops/kendra/create_kendra_idx_opts.png differ diff --git a/workshops/kendra/designer_add_button.png b/workshops/kendra/designer_add_button.png new file mode 100644 index 000000000..f912a86c6 Binary files /dev/null and b/workshops/kendra/designer_add_button.png differ diff --git a/workshops/kendra/kendra_add_datasource.png b/workshops/kendra/kendra_add_datasource.png new file mode 100644 index 000000000..29455824e Binary files /dev/null and b/workshops/kendra/kendra_add_datasource.png differ diff --git a/workshops/kendra/kendra_console_readme.png b/workshops/kendra/kendra_console_readme.png new file mode 100644 index 000000000..2869f1e82 Binary files /dev/null and b/workshops/kendra/kendra_console_readme.png differ diff --git a/workshops/kendra/kendra_homescreen.png b/workshops/kendra/kendra_homescreen.png new file mode 100644 index 000000000..1dadf58c7 Binary files /dev/null and b/workshops/kendra/kendra_homescreen.png differ diff --git a/workshops/kendra/kendra_idxs_tab.png b/workshops/kendra/kendra_idxs_tab.png new file mode 100644 index 000000000..ca3edcd00 Binary files /dev/null and b/workshops/kendra/kendra_idxs_tab.png differ diff --git a/workshops/kendra/kendra_role.png b/workshops/kendra/kendra_role.png new file mode 100644 index 000000000..f0d281722 Binary files /dev/null and b/workshops/kendra/kendra_role.png differ diff --git a/workshops/kendra/kendra_sync_datasource.png b/workshops/kendra/kendra_sync_datasource.png new file mode 100644 index 000000000..33858ba17 Binary files /dev/null and b/workshops/kendra/kendra_sync_datasource.png differ diff --git a/workshops/kendra/kendra_sync_schedule.png b/workshops/kendra/kendra_sync_schedule.png new file mode 100644 index 000000000..38f0029aa Binary files /dev/null and b/workshops/kendra/kendra_sync_schedule.png differ diff --git a/workshops/kendra/load_kendrafallback_ext.png b/workshops/kendra/load_kendrafallback_ext.png new file mode 100644 index 000000000..091ea8e42 Binary files /dev/null and b/workshops/kendra/load_kendrafallback_ext.png differ diff --git a/workshops/kendra/no_hits_question.png b/workshops/kendra/no_hits_question.png new file mode 100644 index 000000000..9e9b06673 Binary files /dev/null and b/workshops/kendra/no_hits_question.png differ diff --git a/workshops/kendra/qnabot_settings_kendra_idx.png b/workshops/kendra/qnabot_settings_kendra_idx.png new file mode 100644 index 000000000..d85782f13 Binary files /dev/null and b/workshops/kendra/qnabot_settings_kendra_idx.png differ diff --git a/workshops/kendra/qnabot_tools_menu.png b/workshops/kendra/qnabot_tools_menu.png new file mode 100644 index 000000000..30015469a Binary files /dev/null and b/workshops/kendra/qnabot_tools_menu.png differ diff --git a/workshops/kendra/qnabot_tools_open_client.png b/workshops/kendra/qnabot_tools_open_client.png new file mode 100644 index 000000000..d65e885e1 Binary files /dev/null and b/workshops/kendra/qnabot_tools_open_client.png differ diff --git a/workshops/kendra/qnabot_tools_open_import.png b/workshops/kendra/qnabot_tools_open_import.png new file mode 100644 index 000000000..b27baecd7 Binary files /dev/null and b/workshops/kendra/qnabot_tools_open_import.png differ diff --git a/workshops/kendra/qnabot_tools_open_settings.png b/workshops/kendra/qnabot_tools_open_settings.png new file mode 100644 index 000000000..d7035d332 Binary files /dev/null and b/workshops/kendra/qnabot_tools_open_settings.png differ diff --git a/workshops/kendra/s3_bucket_upload.png b/workshops/kendra/s3_bucket_upload.png new file mode 100644 index 000000000..3d99b0454 Binary files /dev/null and b/workshops/kendra/s3_bucket_upload.png differ diff --git a/workshops/kendra/s3_create_bucket.png b/workshops/kendra/s3_create_bucket.png new file mode 100644 index 000000000..37b2c0350 Binary files /dev/null and b/workshops/kendra/s3_create_bucket.png differ diff --git a/workshops/kendra/s3_create_bucket_step1.png b/workshops/kendra/s3_create_bucket_step1.png new file mode 100644 index 000000000..6e8fdb65f Binary files /dev/null and b/workshops/kendra/s3_create_bucket_step1.png differ diff --git a/workshops/kendra/s3_create_bucket_step2.png b/workshops/kendra/s3_create_bucket_step2.png new file mode 100644 index 000000000..57cc27c30 Binary files /dev/null and b/workshops/kendra/s3_create_bucket_step2.png differ diff --git a/workshops/kendra/s3_create_bucket_step3.png b/workshops/kendra/s3_create_bucket_step3.png new file mode 100644 index 000000000..e40fa7ee3 Binary files /dev/null and b/workshops/kendra/s3_create_bucket_step3.png differ diff --git a/workshops/kendra/sync_kendra_faq_menu.png b/workshops/kendra/sync_kendra_faq_menu.png new file mode 100644 index 000000000..c9a477087 Binary files /dev/null and b/workshops/kendra/sync_kendra_faq_menu.png differ diff --git a/workshops/reinvent2019/code/solarflare/package-lock.json b/workshops/reinvent2019/code/solarflare/package-lock.json index 66dc2fb5f..1d72e714a 100644 --- a/workshops/reinvent2019/code/solarflare/package-lock.json +++ b/workshops/reinvent2019/code/solarflare/package-lock.json @@ -1125,7 +1125,7 @@ "dev": true, "requires": { "flat": "^4.1.0", - "lodash": "^4.17.15", + "lodash": "^4.17.19", "yargs": "^13.3.0" } } diff --git a/workshops/reinvent2019/templates/public.json b/workshops/reinvent2019/templates/public.json index 725d2072a..413f7dcd5 100644 --- a/workshops/reinvent2019/templates/public.json +++ b/workshops/reinvent2019/templates/public.json @@ -1473,7 +1473,7 @@ "Path": "/", "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", - {"Ref": "EsPolicy"} + {"Ref": "QueryPolicy"} ] } }, @@ -1621,7 +1621,7 @@ "Path": "/", "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", - {"Ref": "EsPolicy"}, + {"Ref": "QueryPolicy"}, "arn:aws:iam::aws:policy/AmazonLexFullAccess" ] } @@ -1927,7 +1927,7 @@ "Path": "/", "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", - {"Ref": "EsPolicy"}, + {"Ref": "QueryPolicy"}, "arn:aws:iam::aws:policy/AmazonLexFullAccess" ] } @@ -1996,7 +1996,7 @@ ] } }, - "EsPolicy": { + "QueryPolicy": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "PolicyDocument": { @@ -2658,7 +2658,7 @@ "Path": "/", "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", - {"Ref": "EsPolicy"} + {"Ref": "QueryPolicy"} ] } },