crawler.algolia Extractors returned 1003 records, the maximum is 750

关键字:Extractors returned too many records

如遇到algolia提取词太多超过750条,可参考docsearch官网文档open in new window,通过aggregateContent选项有助于减少提取器内容级别的记录数。

Reduce the number records

If you encounter the Extractors returned too many records error when your page outputs more than 750 records. The aggregateContentopen in new window option helps you reducing the number of records at the content level of the extractor.

{
  indexName: "YOUR_INDEX_NAME",
  pathsToMatch: ["https://YOUR_WEBSITE_URL/api/**"],
  recordExtractor: ({ $, helpers }) => {
    return helpers.docsearch({
      recordProps: {
        lvl0: "header h1",
        lvl1: "article h2",
        lvl2: "article h3",
        lvl3: "article h4",
        lvl4: "article h5",
        lvl5: "article h6",
        content: "article p, article li",
      },
      aggregateContent: true,
    });
  },
},
Loading...