Algolia search is broken #2030
-
Describe the bugI am experiencing an issue with the integrated search component (Algolia). However, if I perform a search using the API or on Algolia's website, the search function works correctly and returns results. It's possible that there may be an issue with the search component in Vitepress that's causing this problem. I wanted to bring this to your attention in the hopes that it can be addressed and fixed as soon as possible. Reproduction
Expected behaviorShow results after searching System InfoSystem:
OS: macOS 13.2.1
CPU: (8) x64 Apple M1
Memory: 7.73 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
Browsers:
Brave Browser: 107.1.45.133
Chrome: 109.0.5414.119
Chrome Canary: 112.0.5609.0
Firefox: 95.0.2
Firefox Developer Edition: 108.0
Safari: 16.3 Additional contextUI Request:
Request Method:
Validations
|
Beta Was this translation helpful? Give feedback.
Replies: 19 comments 15 replies
-
Please let me know if there is any further information or details I can provide to assist with troubleshooting this issue." |
Beta Was this translation helpful? Give feedback.
-
your index needs the |
Beta Was this translation helpful? Give feedback.
-
Hi, @brc-dd! Thanks for your reply. My question is, why does it work through the API? |
Beta Was this translation helpful? Give feedback.
-
I'm not sure how you're creating that index, but if you'd run algolia's crawler it would've indexed the html lang attribute too. It's working through the API because you haven't specified |
Beta Was this translation helpful? Give feedback.
-
Im using the free quote, I don't have access to the crawler. I'm completely new to Algolia, I may be missing something (?) |
Beta Was this translation helpful? Give feedback.
-
Just a clarification on our side: we only support https://docsearch.algolia.com/ (docsearch is free for open-source libraries). If that's the case for you, then you can use https://crawler.algolia.com/admin/ to access crawler configuration. If that's not the case, then you will need to build your own search component or use any of the ones mentioned at #670 |
Beta Was this translation helpful? Give feedback.
-
Thanks for your clarification. It's a public repo and it's open source. So if I'm not wrong, I should have access to the algolia crawler, right? |
Beta Was this translation helpful? Give feedback.
-
Yeah, you should have, can you try logging in that admin dashboard? |
Beta Was this translation helpful? Give feedback.
-
Thank you. Actually, I dont have access. But it looks like an auth error. I will try later. |
Beta Was this translation helpful? Give feedback.
-
If it's a blocker than try downgrading to |
Beta Was this translation helpful? Give feedback.
-
I just requested access to the crawler. It seems to be that was the problem. As feedback, I think Vitepress docs should provide more context about how Algolia should work. |
Beta Was this translation helpful? Give feedback.
-
If you really need a fast solution and you need the newest vitepress version you can try //vite.config.ts
import { SearchPlugin } from "vitepress-plugin-search";
import { defineConfig } from "vite";
//default options
var options = {
...flexSearchIndexOptions,
previewLength: 62,
buttonLabel: "Search",
placeholder: "Search docs",
};
export default defineConfig({
plugins: [SearchPlugin(options)],
}); |
Beta Was this translation helpful? Give feedback.
-
Yeah, the docs are missing many things. I agree that it's sort of ironic considering we are building a docs-centered framework 😅. But yeah we will update that with an official crawler config and hopefully support for local search as well. After you get access, try adding attributesForFaceting (ref. #1935 (comment)) |
Beta Was this translation helpful? Give feedback.
-
Thank you very mucho, amigo. I'll let you know how it goes. @MarkusKeck I want to try using the default search component, I'll try your solution if I can't get it to work. |
Beta Was this translation helpful? Give feedback.
-
I just got a message, it says my site won't be accepted bcs is under construction and has tons of |
Beta Was this translation helpful? Give feedback.
-
Let's move this to discussion. If there is any issue you need some help you can directly post in our discord too. For now you can either wait for approval or use the plugin Markus mentioned above. |
Beta Was this translation helpful? Give feedback.
-
@brc-dd I tried https://docsearch.algolia.com/docs/legacy/run-your-own/#integration with docker the crawl config: {
"index_name": "orillusion",
"start_urls": [
{
"url": "https://xxxx.com/guide/",
"variables": {
"lang": [
"zh"
],
"version": [
"latest"
]
},
"page_rank": 5,
"selectors_key": "doc"
},
{
"url": "https://xxxx.com/api/",
"variables": {
"lang": [
"en",
"zh"
],
"version": [
"latest"
]
},
"page_rank": 4,
"selectors_key": "api"
}
],
"selectors": {
"doc":{
"lvl0": ".vp-doc h1",
"lvl1": ".vp-doc h2",
"lvl2": ".vp-doc h3",
"lvl3": ".vp-doc h4",
"text": ".vp-doc p, .vp-doc ul, .vp-doc ol"
},
"api":{
"lvl0": ".vp-doc h1",
"lvl1": ".vp-doc h3"
}
}
} The record in Algolia dashboard works fine algolia: {
appId: 'xxxxxx',
apiKey: 'xxxxxxx',
indexName: 'orillusion',
searchParameters:{
facetFilters: ["lang:zh", "version:latest"]
}
} But I can't get any search record in vitepress, do I miss someting? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Algolia is working! I just got accepted to join the program for free and they sent me the appId and the apiKey and now everything works as expected. |
Beta Was this translation helpful? Give feedback.
I just got a message, it says my site won't be accepted bcs is under construction and has tons of
lorem ipsum
s text. But I think when I finish creating the website, I will be given access to the tool.