Algolia Search results have no content #4872
Replies: 2 comments 3 replies
-
|
It is hard to help you if we can't see your site live, it's config or source code, and it's algolia docsearch config (if you even use DocSearch?). Afaik nobody tested the Netlify system yet and we don't document it yet, so you are in unknown territory here @shortcuts any idea if the Netlify Algolia Crawler Plugin is usable with a Docusaurus site and Docsearch? Should we use it ourselves on Docusaurus site and document this workflow? What are the advantages? Maybe not wait a scheduled recrawl? |
Beta Was this translation helpful? Give feedback.
-
|
The DocSearch library follow a specific record structure, which is not the default indexing of the Algolia Crawler. With the open-source DocSearch crawler, we use a specific template for any Docusaurus v2 websites that you can translate with the help of the built-in DocSearch helper in the Algolia Crawler. The recordExtractor: ({ url, $, contentLength, fileType, helpers }) => {
return helpers.docsearch({
selectors: {
// Algolia Crawler doesn't support xPath, so we rely on cheerio ($) here
lvl0: $('.menu__link.menu__link--sublist.menu__link--active').text() || $('.navbar__item.navbar__link--active').text(),
lvl1: ".header h1",
lvl2: ".article h2",
lvl3: ".article h3",
lvl4: ".article h4",
lvl5: ".article h5",
content: "article p, article li, article td:last-child",
},
});
},Any records in your Algolia index will now have the right format to be used with our front-end library! Since this is a fairly new feature, If you see any issue with the output from the Crawler, feel free to open an issue on the DocSearch repository so we can iterate on it! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Everyone,
i've published my docs via netlify and installed there the Netlify Algolia Crawler Plugin. After some configuration i finally managed it to get any results shown in the search modal.
Sadly the only parameters i see in there are the page headings:

Does anybody have a clue, what may be wrong with the settings?
Beta Was this translation helpful? Give feedback.
All reactions