[英]Ravendb single or multiple indexes needed?
我有一个简单的文档结构,例如:
public class CulturedData
{
public string Culture { get; set; }
public string Text { get; set; }
}
public class Product
{
public int Id { get; set; }
public decimal Price { get; set; }
public List<CulturedData> Titles { get; set; }
public List<CulturedData> Descriptions { get; set; }
}
Culture = "EN" or "DE" or "FR" etc.
我想知道使用它们各自的Text属性对产品进行关键字搜索的最佳方法。 “描述”的文本内容可能很大,可能为20-30K。 索引此类数据的最佳方法是什么,对于每种区域性,我是否需要单独的索引?
使用“ 更喜欢此功能”也很不错, 这是否意味着我被迫选择了特定的索引编制路径?
如有其他疑问/解释,请询问。
问候菲尔
您可以使用单个索引,如下所示:
from p in products
select new
{
_ = p.Titles.Select(x=>CreateField("Titles_" + x.Culture, x.Text)),
_+ = p.Descriptions.Select(x=>CreateField("Descriptions_" + x.Culture, x.Text)),
}
那应该给您您想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.