{ "results":[ { "name":"Default Search API Key", "description":"Use it to search from the frontend", "key":"04c633b21ec1e6723dcf9215455c68ac321d85a3c11fc7429c2dd806f84c9e28", "uid":"3129fff7-e093-4a4a-b62e-3c68dfb41790", "actions":[ "search" ], "indexes":[ "*" ], "expiresAt":null, "createdAt":"2023-09-20T13:08:33.768044056Z", "updatedAt":"2023-09-20T13:08:33.768044056Z" }, { "name":"Default Admin API Key", "description":"Use it for anything that is not a search operation. Caution! Do not expose it on a public frontend", "key":"3dc38a7f9f012f3c22c7e568755c93d7b5112e10732ba4305cbb8229288e50ea", "uid":"5b00b4d7-ea88-473e-9f6b-229b04d73f6f", "actions":[ "*" ], "indexes":[ "*" ], "expiresAt":null, "createdAt":"2023-09-20T13:08:33.58142974Z", "updatedAt":"2023-09-20T13:08:33.58142974Z" } ], "offset":0, "limit":20, "total":2 }
<body> <inputtype="search"id="search-bar-input"> <scriptsrc="https://cdn.jsdelivr.net/npm/docs-searchbar.js@latest/dist/cdn/docs-searchbar.min.js"></script> <script> docsSearchBar({ hostUrl: 'http://192.168.0.197:7700', apiKey: '04c633b21ec1e6723dcf9215455c68ac321d85a3c11fc7429c2dd806f84c9e28', indexUid: 'blog', inputSelector: '#search-bar-input', debug: true// Set debug to true if you want to inspect the dropdown }); </script> </body> </html>
预览: