我有一个索引,我试图在algolia中传递查询的初始值.我正在使用instantsearch.js,现在它只是加载我的索引中的所有内容.如何在页面加载时将初始值传递给索引?
例如Select * from index where Category='Careers'(将职业作为负载上的值传递)
我搜索了这个文档并且无法弄明白.
此外,我需要传递多个值,如下所示:
select * from index where Category = 'Careers' or 'Skills' or 'Interests' (带或声明)
谢谢!
尝试将对象发布到索引时,我收到以下响应:
{
"message": "lexical error: malformed number, a digit is required after the minus sign. Around '------WebK' near line:1 column:1", "status": 400
}
Run Code Online (Sandbox Code Playgroud)
我能做些什么来解决这个问题?
我在我的网页上成功设置了一个algolia搜索引擎.我的后端将公共数据同步到algolia,搜索栏工作得很好.
现在我想为我的管理应用程序设置相同的内容.与公共应用程序不同,此应用程序应该能够从algolia恢复秘密数据.
到目前为止,我可以考虑两种方法:
要么
my_admin_collection_index,复制设置,并像my_collection_index管理应用程序一样使用它.所以在第一个版本中我搜索相同的索引,但是使用不同的标签; 在第二个版本中,我搜索两个不同的索引.
是否有一些关于如何在两种方法之间做出选择的见解?我会说我会更容易复制文档并在其上添加一些标签,但我无法真正说明这种方法对性能的影响.
谢谢 !
我想将 cloud firestore 数据发送到 algolia 以启用全文搜索。Firebase 云函数日志显示有关应用程序 ID 的错误。我无法理解这个错误以及如何解决这个问题。
name: 'RetryError',
message: 'Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.'
Run Code Online (Sandbox Code Playgroud)
这是我的index.js 文件
exports.addFirestoreDataToAlgolia =
functions.https.onRequest((req, res) => {
var arr = [];
admin.firestore().collection("tags").get()
.then((docs) => {
docs.forEach((doc) => {
let user = doc.data();
user.objectID = doc.id;
arr.push(user);
})
const client = algoliasearch(ALGOLIA_ID, ALGOLIA_ADMIN_KEY);
const index = client.initIndex(ALGOLIA_INDEX_NAME);
return index.saveObjects(arr, (err, content) => {
if (err) {
res.status(500);
}
else {
res.status(200).send(content);
}
}) …Run Code Online (Sandbox Code Playgroud) 我们正在使用 Algolia 的 vue instantsearch。
当用户登陆带有一些初始 url 参数的页面时,algolia instantsearch 会加载初始搜索,并更改 url 以包含搜索参数。然而,当 algolia 重写 url 时,初始 url 参数不会保留,我们希望它们保留。即e
/stuff?myparam=value/stuff?refinementList=...url 参数。myparam有没有办法将其保留在网址中?我有一个相当复杂的 Next.js 网站,主要是静态呈现的,并且我正在将 Algolia 搜索添加到该网站中。Algolia 的机制要求您使用他们的 API,并在每次发布附加内容时通知他们。
我的问题是在 Next 应用程序中您通知 Algolia 的位置。鉴于我的网站用于getStaticProps获取数据,我认为这是通知和更新 Algolia 的合理位置。它有效,但想知道其他人做了什么、最佳实践、权衡等等。
生命周期如下所示:
uuid)实现这一点的代码:
// Use nextjs getStaticProps, destructure default params
export async function getStaticProps({ params, preview = false, previewData }) {
// Data fetch (assume getAllNewsForLandingPage gets an array of obj)
pageData.data = await getAllNewsForLandingPage(params.uid, previewData)
// Format and normalize results
const algoliaFormattedData = dataFormatter(pageData.data)
// …Run Code Online (Sandbox Code Playgroud) 我正在使用 algolia 的 InstantSearch 创建一个输入字段,但我在调试这个交叉的来源时遇到了麻烦。当输入字段获得焦点或悬停时,会出现蓝色十字,看起来像是清除了查询。(我已经有一个用于重置的按钮)。检查元素在悬停/聚焦时不会显示任何“弹出”内容,我想知道它是如何到达那里的
\n有什么我跳过的吗?或者在CSS中添加额外的内容?在实施之前我可能已经使用了一个模板
\n\n我的html:
\n <div className="items-center h-full">\n <InstantSearch\n indexName={variables.ALGOLIA_INDEX}\n searchClient={algolia}\n >\n <div className="h-full flex flex-col items-center justify-center">\n <SearchBox\n translations={{\n placeholder: \'\',\n resetTitle: \'T\xc3\xb8m s\xc3\xb8kefeltet\',\n }}\n reset={\n <SearchCloseIcon className=" h-5 md:h-10 transform duration-500 hover:scale-110 cursor-pointer" />\n }\n autoFocus={true}\n />\n <Results />\n </div>\n </InstantSearch>\n </div>\nRun Code Online (Sandbox Code Playgroud)\n我的CSS:
\n.ais-SearchBox {\n}\n\n.ais-SearchBox-form {\n display: flex;\n}\n.ais-Pagination {\n margin-top: 1em;\n}\n.ais-SearchBox-resetIcon {\n height: 2rem;\n width: 2rem;\n}\n.left-panel {\n float: left;\n width: 250px;\n}\n\n.right-panel {\n margin-left: 260px;\n}\n\n.ais-InstantSearch {\n max-width: 960px;\n overflow: hidden;\n margin: …Run Code Online (Sandbox Code Playgroud) 所以我有一个问题,我正在为 Firebase 开发 Algolia 扩展,但是当我尝试第 3 步(参见下图 2)执行命令时,我收到“bash: firestore-algolia-search: command not found”错误,尽管我安装了 npx 有谁知道为什么吗?
我目前在一个集合上使用 Algolia,但我也想在另一个集合中单独搜索,有没有办法向 Algolia 添加第二个集合
我的 URL 中预定义了一些过滤器和查询参数。我需要在 URL 中添加一些其他参数来跟踪用户的来源和其他一些目的。但是,每当我进行新的细化或进入新页面(分页)时。附加参数已被删除。我怎样才能保留这些参数,直到我转到任何其他路线?
algolia ×10
firebase ×3
javascript ×3
reactjs ×2
command-line ×1
facet ×1
filter ×1
next.js ×1
tailwind-css ×1