来自TypeSense/Docsearch-Scraper的消息问题

发布于 2025-02-12 01:00:18 字数 4297 浏览 1 评论 0原文

我们将在安装Ubuntu的WSL上托管Typesens。我们正在尝试将其作为我们大型文档网站的搜索引擎。 Typesense似乎已正确安装。当运行以下命令时:

 curl http://localhost:8108/health

运行以下消息:

{"ok":true}

但是,运行以下命令时:

docker run -it  --add-host=host.docker.internal:host-gateway  --env-file=docker.env -e "CONFIG=$(cat config.json | jq -r tostring)" typesense/docsearch-scraper

显示与以下类似的一系列消息:

DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): host.docker.internal:8108
DEBUG:urllib3.connectionpool:http://host.docker.internal:8108 "POST /collections/docusaurus-2_1656520440/documents/import HTTP/1.1" 200 None
DEBUG:typesense.api_call:host.docker.internal:8108 is healthy. Status code: 200
> DocSearch: https://docusaurus.io/zh-CN/docs/migration 39 records)
DEBUG:typesense.api_call:Making post /collections/docusaurus-2_1656520440/documents/import
DEBUG:typesense.api_call:Try 1 to node host.docker.internal:8108 -- healthy? True
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): host.docker.internal:8108
DEBUG:urllib3.connectionpool:http://host.docker.internal:8108 "POST /collections/docusaurus-2_1656520440/documents/import HTTP/1.1" 200 None
DEBUG:typesense.api_call:host.docker.internal:8108 is healthy. Status code: 200
> DocSearch: https://docusaurus.io/ko/docs/migration 39 records)
DEBUG:typesense.api_call:Making post /collections/docusaurus-2_1656520440/documents/import
DEBUG:typesense.api_call:Try 1 to node host.docker.internal:8108 -- healthy? True
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): host.docker.internal:8108
DEBUG:urllib3.connectionpool:http://host.docker.internal:8108 "POST /collections/docusaurus-2_1656520440/documents/import HTTP/1.1" 200 None
DEBUG:typesense.api_call:host.docker.internal:8108 is healthy. Status code: 200
> DocSearch: https://docusaurus.io/pt-BR/docs/migration 39 records)
DEBUG:scrapy.core.engine:Crawled (200) <GET https://docusaurus.io/docs/next/migration> (referer: https://docusaurus.io/docs/migration)
DEBUG:scrapy.core.engine:Crawled (200) <GET https://docusaurus.io/docs/2.0.0-beta.20/migration> (referer: https://docusaurus.io/docs/migration)
DEBUG:scrapy.core.engine:Crawled (200) <GET https://docusaurus.io/fr/docs/migration> (referer: https://docusaurus.io/docs/migration)
DEBUG:typesense.api_call:Making post /collections/docusaurus-2_1656520440/documents/import
DEBUG:typesense.api_call:Try 1 to node host.docker.internal:8108 -- healthy? True
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): host.docker.internal:8108
DEBUG:urllib3.connectionpool:http://host.docker.internal:8108 "POST /collections/docusaurus-2_1656520440/documents/import HTTP/1.1" 200 None

这些消息持续了很长时间。

ENV文件的内容如下:

TYPESENSE_API_KEY=xyz
TYPESENSE_HOST=host.docker.internal
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http

config.json文件的内容如下:

{
  "index_name": "config",
  "start_urls": [
      {
          "url": "http://192.168.16.1:3000/docs/book",
      
      }
  ],
  "selectors": {
      "default": {
          "lvl0": ".theme-default-content h1",
          "lvl1": ".theme-default-content h2",
          "lvl2": ".theme-default-content h3",
          "lvl3": ".theme-default-content h4",
          "lvl4": ".theme-default-content h5",
          "text": ".theme-default-content p, .theme-default-content ul li, .theme-default-content table tbody tr"
      }
  },
  "strip_chars": " .,;:#"
}

config.json文件中的URL准确。

Docusaurus.config.js文件的相关部分如下:

  themes: ['docusaurus-theme-search-typesense'],
  themeConfig: 

    /** @type {import('@docusaurus/preset-classic').ThemeConfig} */     
         
    {
    typesense: {
      typesenseCollectionName: 'http://192.168.16.1:3000/docs/book', // Replace with your own doc site's name. Should match the collection name in the scraper settings.
      
      typesenseServerConfig: {
        nodes: [
          {
            host: 'DESKTOP-XXXXDPV',
            port: 443,
            protocol: 'https',
          },
        ],
        apiKey: 'xyz',
      },
    },
  },

Typesense搜索框正确显示,但没有显示搜索结果。

有人会知道我做错了什么吗?

我已经搜寻了内部寻找解决方案。

谢谢 凯文

We are hosting typesense on WSL where ubuntu is installed. We are trying to implement this as the search engine for our large documentation site. Typesense seems to be installed properly. When the following command is run:

 curl http://localhost:8108/health

is run, the following message is displayed:

{"ok":true}

However, when the following command is run:

docker run -it  --add-host=host.docker.internal:host-gateway  --env-file=docker.env -e "CONFIG=$(cat config.json | jq -r tostring)" typesense/docsearch-scraper

A series of messages similar to the following are displayed:

DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): host.docker.internal:8108
DEBUG:urllib3.connectionpool:http://host.docker.internal:8108 "POST /collections/docusaurus-2_1656520440/documents/import HTTP/1.1" 200 None
DEBUG:typesense.api_call:host.docker.internal:8108 is healthy. Status code: 200
> DocSearch: https://docusaurus.io/zh-CN/docs/migration 39 records)
DEBUG:typesense.api_call:Making post /collections/docusaurus-2_1656520440/documents/import
DEBUG:typesense.api_call:Try 1 to node host.docker.internal:8108 -- healthy? True
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): host.docker.internal:8108
DEBUG:urllib3.connectionpool:http://host.docker.internal:8108 "POST /collections/docusaurus-2_1656520440/documents/import HTTP/1.1" 200 None
DEBUG:typesense.api_call:host.docker.internal:8108 is healthy. Status code: 200
> DocSearch: https://docusaurus.io/ko/docs/migration 39 records)
DEBUG:typesense.api_call:Making post /collections/docusaurus-2_1656520440/documents/import
DEBUG:typesense.api_call:Try 1 to node host.docker.internal:8108 -- healthy? True
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): host.docker.internal:8108
DEBUG:urllib3.connectionpool:http://host.docker.internal:8108 "POST /collections/docusaurus-2_1656520440/documents/import HTTP/1.1" 200 None
DEBUG:typesense.api_call:host.docker.internal:8108 is healthy. Status code: 200
> DocSearch: https://docusaurus.io/pt-BR/docs/migration 39 records)
DEBUG:scrapy.core.engine:Crawled (200) <GET https://docusaurus.io/docs/next/migration> (referer: https://docusaurus.io/docs/migration)
DEBUG:scrapy.core.engine:Crawled (200) <GET https://docusaurus.io/docs/2.0.0-beta.20/migration> (referer: https://docusaurus.io/docs/migration)
DEBUG:scrapy.core.engine:Crawled (200) <GET https://docusaurus.io/fr/docs/migration> (referer: https://docusaurus.io/docs/migration)
DEBUG:typesense.api_call:Making post /collections/docusaurus-2_1656520440/documents/import
DEBUG:typesense.api_call:Try 1 to node host.docker.internal:8108 -- healthy? True
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): host.docker.internal:8108
DEBUG:urllib3.connectionpool:http://host.docker.internal:8108 "POST /collections/docusaurus-2_1656520440/documents/import HTTP/1.1" 200 None

These messages continue for a long time.

The contents of the env file are as follows:

TYPESENSE_API_KEY=xyz
TYPESENSE_HOST=host.docker.internal
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http

The contents of the config.json file are as follows:

{
  "index_name": "config",
  "start_urls": [
      {
          "url": "http://192.168.16.1:3000/docs/book",
      
      }
  ],
  "selectors": {
      "default": {
          "lvl0": ".theme-default-content h1",
          "lvl1": ".theme-default-content h2",
          "lvl2": ".theme-default-content h3",
          "lvl3": ".theme-default-content h4",
          "lvl4": ".theme-default-content h5",
          "text": ".theme-default-content p, .theme-default-content ul li, .theme-default-content table tbody tr"
      }
  },
  "strip_chars": " .,;:#"
}

The URL in config.json file is accurate.

The relevant part of the docusaurus.config.js file is as follows:

  themes: ['docusaurus-theme-search-typesense'],
  themeConfig: 

    /** @type {import('@docusaurus/preset-classic').ThemeConfig} */     
         
    {
    typesense: {
      typesenseCollectionName: 'http://192.168.16.1:3000/docs/book', // Replace with your own doc site's name. Should match the collection name in the scraper settings.
      
      typesenseServerConfig: {
        nodes: [
          {
            host: 'DESKTOP-XXXXDPV',
            port: 443,
            protocol: 'https',
          },
        ],
        apiKey: 'xyz',
      },
    },
  },

The Typesense search box appears properly but no search results appear.

Would anyone have a clue as to what i am doing wrong?

I have scoured the Internate looking for a solution.

Thanks
Kevin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文