Skip to content

Commit

Permalink
Change schema to include promptQueries
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Nov 25, 2021
1 parent aecbcaf commit 4da1510
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/SearchBlock/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const SearchBlockSchema = ({ formData = {} }) => ({
{
id: 'general',
title: 'General settings',
fields: ['headline', 'subheadline', 'demoquestion', 'enableNLP'],
fields: ['headline', 'subheadline', 'promptQueries', 'enableNLP'],
},
...(formData?.enableNLP
? [
Expand Down Expand Up @@ -53,9 +53,10 @@ export const SearchBlockSchema = ({ formData = {} }) => ({
title: 'Text below headline',
configPath: 'subheadline',
},
demoquestion: {
title: 'Demo question',
configPath: 'demoquestion',
promptQueries: {
title: 'Prompt questions',
configPath: 'promptQueries',
widget: 'textarea',
},

use_qa_dp: {
Expand Down
4 changes: 2 additions & 2 deletions src/middleware/elasticsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const handleDownload = (req, res, next, { appName, urlNLP, urlES }) => {
download(urlES, appConfig, req, res);
};

const DOC_ID = /.*_doc\/(?<url>.+)/m;
const DOC_ID_RE = /.*_doc\/(?<url>.+)/m;

const handleDocRequest = (req, res, next, { urlES, docId }) => {
const url = `${urlES}/_doc/${docId}`;
Expand All @@ -119,7 +119,7 @@ export const createHandler = ({ urlNLP, urlES }) => {
.find((b) => b);

if (appName) {
const docId = req.path.match(DOC_ID).groups['url'];
const docId = req.path.match(DOC_ID_RE).groups['url'];
handleDocRequest(req, res, next, { urlES, docId });
return;
}
Expand Down

0 comments on commit 4da1510

Please sign in to comment.