哪个 NoSQL DB 适用于多字段搜索

Which NoSQL DB is advisable for multi-field search

假设我们有一个可以包含 50-60 个字段的文档。例如:

{  
  "priceCurrency": "USD",
  "price": "119.99",
  "priceValidUntil": "2020-11-05",
  "brand": "Acme",
  "logo": "http://www.example.com/logo.png",
  "name": "WidgetPress",
  "category": "Widgets",
  "image": "http://www.example.com/image.jpg",
  "description": "This is an excellent widget with 21 features and 4 colors."
}

现在,在这 60 个字段中,我们可以查询 20-25 个字段。所以这意味着我们需要所有这些字段的索引。

在这些字段上形成的查询可以有相等和不等运算符。查询也可以有 AND/OR/NOT 个运算符。

不会有全文检索要求。

对于这种情况,ElasticSearch 或 MongoDB 是首选?

我在一篇文章中读到,在 mongo 中支持多于 5 个索引可能会使写入变慢。所以在这种情况下,ES应该是首选。

我们的数据大约是 200 GB。 RPS 为 20,000。`

编辑问题 - 只是想知道 ScyllaDB 对这个用例有意义吗?

虽然不能完全回答您的问题, 应该可以让您了解如何根据功能和非功能要求选择系统。

根据您的主要要求,是的,您不需要为没有进行任何搜索的数据建立索引,使用 index option,您可以禁用特定字段的索引(注意默认为 true)。这将减少倒排索引的大小并提高性能。

第二部分是使用filter context,因为你没有全文搜索需求,Elasticsearch将数据缓存在filter context中,速度非常快,不需要引入外部缓存系统,如Redis等

可以在 https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context 中找到有关过滤器缓存的更多信息 官方文档,并引用同一文档:

Frequently used filters will be cached automatically by Elasticsearch, to speed up performance.

此外,

In a filter context, a query clause answers the question “Does this document match this query clause?” The answer is a simple Yes or No — no scores are calculated. Filter context is mostly used for filtering structured data, e.g.

Does this timestamp fall into the range 2015 to 2016? Is the status field set to "published"

这似乎是您的确切要求。