AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1145412
Accepted
Rudolf Vavruch
Rudolf Vavruch
Asked: 2023-10-08 17:49:21 +0800 CST2023-10-08 17:49:21 +0800 CST 2023-10-08 17:49:21 +0800 CST

Meilisearch 按日期过滤在生产中不起作用,但在本地起作用

  • 772

我已经在生产中的 Kubernetes 上设置了 Meil​​isearch,如下: https: //github.com/meilisearch/meilisearch-kubernetes 在我的本地,我使用 Laravel Sail(但不是 Scout)。

我的本地安装和生产安装之间的主要区别是:

  • 版本 - 本地为 1.2,生产为 1.4
  • 文档数量 - 本地有 82K,生产有 550 万个
  • 我通过 PHP SDK 在本地加载文档,并在生产中通过 cURL 以 98MB 的 CSV 文件上传。

索引的设置似乎是相同的。基本搜索和其他过滤器正在运行,并且排序似乎也正常。

curl -X GET 'http://production/indexes/posts/settings'(我正在使用 k8s 端口转发来访问生产环境 - 它没有公开暴露)

{
  "displayedAttributes": [
    "*"
  ],
  "searchableAttributes": [
    "*"
  ],
  "filterableAttributes": [
    "created_at",
    "doctype",
    "topic_title",
    "user"
  ],
  "sortableAttributes": [
    "created_at"
  ],
  "rankingRules": [
    "words",
    "typo",
    "proximity",
    "attribute",
    "sort",
    "exactness"
  ],
  "stopWords": [],
  "nonSeparatorTokens": [],
  "separatorTokens": [],
  "dictionary": [],
  "synonyms": {},
  "distinctAttribute": null,
  "typoTolerance": {
    "enabled": true,
    "minWordSizeForTypos": {
      "oneTypo": 5,
      "twoTypos": 9
    },
    "disableOnWords": [],
    "disableOnAttributes": []
  },
  "faceting": {
    "maxValuesPerFacet": 100,
    "sortFacetValuesBy": {
      "*": "alpha"
    }
  },
  "pagination": {
    "maxTotalHits": 1000
  }
}

curl -X GET 'http://localhost:7700/indexes/posts/settings'

{
  "displayedAttributes": [
    "*"
  ],
  "searchableAttributes": [
    "*"
  ],
  "filterableAttributes": [
    "created_at",
    "doctype",
    "topic_title",
    "user"
  ],
  "sortableAttributes": [
    "created_at"
  ],
  "rankingRules": [
    "words",
    "typo",
    "proximity",
    "attribute",
    "sort",
    "exactness"
  ],
  "stopWords": [],
  "synonyms": {},
  "distinctAttribute": null,
  "typoTolerance": {
    "enabled": true,
    "minWordSizeForTypos": {
      "oneTypo": 5,
      "twoTypos": 9
    },
    "disableOnWords": [],
    "disableOnAttributes": []
  },
  "faceting": {
    "maxValuesPerFacet": 100
  },
  "pagination": {
    "maxTotalHits": 1000
  }
}

但是,当我使用日期过滤器进行查询时,我没有从生产中得到任何结果。我已确认索引中存在我期望的文档。

curl -X POST 'http://production/indexes/posts/search' -H 'Content-Type: application/json' --data-binary '{"q": "hidden", "filter": "created_at > 1039529906"}'

{"hits":[],"query":"hidden","processingTimeMs":3,"limit":20,"offset":0,"estimatedTotalHits":0}

而在本地它工作正常

curl -X POST 'http://localhost:7700/indexes/posts/search' -H 'Content-Type: application/json' --data-binary '{"q": "hidden", "filter": "created_at > 1039529906"}'

{"hits":[...lots of hits returned ...],"query":"hidden","processingTimeMs":1,"limit":20,"offset":0,"estimatedTotalHits":106}

当前没有正在运行的任务,我昨晚加载了文档:

curl -X GET 'http://production/tasks?statuses=processing'

{"results":[],"total":0,"limit":20,"from":null,"next":null}

我的下一步是终止生产中的索引并再次重新加载数据。不确定这是否会有所作为。

kubernetes
  • 1 1 个回答
  • 54 Views

1 个回答

  • Voted
  1. Best Answer
    Rudolf Vavruch
    2023-10-17T02:00:29+08:002023-10-17T02:00:29+08:00

    解决方案是我将字段设置created_at为CSV 中的字符串,而不是数字。

    我删除了索引并重新创建并像以前一样进行设置。然后重新创建并上传 CSV,并将该集设置created_at为数字,现在一切正常。

    • 0

相关问题

  • Nvidia Config 后 Containerd 无法启动

  • 在使用 kubeadm 引导集群之前,如何修改 CoreDNS 配置映射?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve