SOLR/C# - 是否可以查询一个 SOLR 索引,并从另一个索引附加文档?

SOLR/C# - Is it possible to query one SOLR index, and attach a document from another index?

假设我有一个包含产品数据的索引:

productid
productprice
productcategory
productname

以及带有客户价格的索引二:

customerid
customerprice
productid

我将如何进行查询以索引一,其中(如果客户已登录),有一个字段从索引二检索匹配值(客户 ID、产品 ID)?

是否需要索引二,或者是否有更有效的方法来 store/retrieve 客户特定价格?

提前致谢

更新

大约有 7.000 个客户和 200 万个价格,如果您需要 "scope" 性能。

首先做一些简单的/工作的事情。

1) 解决方案 1 / SOLR 索引 Solr 不是数据库,它是搜索引擎,但如果您的价格非常不稳定(变化很大......等等)。最好去实现数据库。

There is approximately 7.000 customers and 2 million prices, if you need a "scope" on performance. Solr is done to manage a lot of references. Don't be afraid of that, you need to build good indexes, the rest is managed by solr.

尽管如此,如果您想使用 solr,请对以下字段执行一个索引:

- productid 
- productprice 
- productcategory 
- productname 
- customerid
- customerprice

2) 我会建议你使用Redis DB,你的用例并不是真正的搜索引擎。在 redis 中,你将像这样存储

product:{productid} => {productprice, productcategory, productname}
product:{productid}:customer:{custumerid} => {customerprice}

Redis 速度极快,可调用并加载到内存中!