switch search function to typesense search

This commit is contained in:
2026-02-07 20:13:03 +08:00
parent cf197c75ab
commit f2c0635ee8
9 changed files with 695 additions and 630 deletions

27
genkey.js Normal file
View File

@@ -0,0 +1,27 @@
const http = require('https');
const data = JSON.stringify({
"description": "Public search only key",
"actions": ["documents:search"],
"collections": ["blogs"]
});
const options = {
hostname: 'typesense.biss.click', // 不要带 https://
port: 443,
path: '/keys',
method: 'POST',
headers: {
'X-TYPESENSE-API-KEY': 'tDPfzkghH3Zy55DHyWOnYkQiijOqN8bx',
'Content-Type': 'application/json',
'Content-Length': data.length
}
};
const req = http.request(options, res => {
res.on('data', d => { process.stdout.write(d); });
});
req.on('error', error => { console.error(error); });
req.write(data);
req.end();