Skip to content

Commit

Permalink
documents switch
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmullen committed May 19, 2022
1 parent bb6910f commit c4bfe69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/cms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ A Canon site often takes the form of DataCountry.io, and is made of **Profiles**
| `CANON_CMS_REQUESTS_PER_SECOND` | Sets the `requestsPerSecond` value in the [promise-throttle](https://www.npmjs.com/package/promise-throttle) library, used for rate-limiting Generator requests | 20 |
| `CANON_CMS_GENERATOR_TIMEOUT` | The number of ms after which a generator request times out, defaults to 5s. Increase this if you are making heavy requests that exceed 5s | 5000 |
| `CANON_CMS_DEEPSEARCH_API` | Server location of Deepsearch API | `undefined` |
| `CANON_CMS_LUNR` | Enable Basic LUNR search | `undefined` |
| `CANON_CMS_HTACCESS_USER` | Authentication user for PDF generation on .htaccess protected pages | `undefined` |
| `CANON_CMS_HTACCESS_PW` | Authentication password for PDF generation on .htaccess protected pages | `undefined` |
| `CANON_CMS_PDF_DISABLE` | Disable the PDF generation endpoint | `undefined` |
Expand Down
16 changes: 9 additions & 7 deletions packages/cms/src/cache/searchIndexByLocale.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ module.exports = async function(app) {

results.forEach(result => {
const content = result.content.find(d => d.locale === locale);
const payload = content ? {
id: content.id,
name: content.name,
keywords: content.keywords,
attr: content.attr
} : {};
this.add(payload, {boost: result.zvalue});
if (content) {
const payload = {
id: content.id,
name: content.name,
keywords: content.keywords,
attr: content.attr
};
this.add(payload, {boost: result.zvalue});
}
}, this);
});
}
Expand Down

0 comments on commit c4bfe69

Please sign in to comment.