gpt4 book ai didi

ravendb - 鉴于这些要求,我如何为该文档构建我的 RavenDb 静态索引?

转载 作者:行者123 更新时间:2023-12-02 00:23:20 24 4
gpt4 key购买 nike

我有将近 300 万份文档存储在 RavenDb 嵌入式实例中。每个字段都将受到某种类型的过滤器/查询/排序的影响,但我特别想对 info 和 info2 列进行某种类型的智能文本搜索。我该如何构建 RavenDb 索引?

我在 info2 列的第一次传递看起来像这样。

store.DatabaseCommands.PutIndex("ProdcustByInfo2", new IndexDefinitionBuilder<Product>
{
Map = products => from product in products
select new { product.INFO2 },
Indexes = { { x => x.INFO2, FieldIndexing.Analyzed } }
});

谢谢,斯蒂芬

[Serializable]
public class Product
{
public string AveWeight { get; set; }

public string BrandName { get; set; }

public string CasePack { get; set; }

public string Catalog { get; set; }

public decimal CatalogId { get; set; }

public decimal CategoryId { get; set; }

public string Info { get; set; }

public bool IsOfflineSupplierItem { get; set; }

public bool IsRebateItem { get; set; }

public bool IsSpecialOrderItem { get; set; }

public bool IsSpecialPriceItem { get; set; }

public bool IsTieredPricingItem { get; set; }

public string ItemNum { get; set; }

public string ManufactureName { get; set; }

public string ManufactureNum { get; set; }

public decimal OffineSupplierId { get; set; }

public string PackageRemarks { get; set; }

public decimal Price { get; set; }

public decimal PriceGroupId { get; set; }

public decimal ProductId { get; set; }

public string ProductName { get; set; }

public int Quantity { get; set; }

public string SupplierName { get; set; }

public string UOM { get; set; }

public string Upc { get; set; }

public string Url { get; set; }

}

最佳答案

斯帕滕,

创建单个 RavenDB 索引,输出您有兴趣查询的所有属性。将 Info2 和 Info 标记为全文搜索(已分析)。

你已经差不多完成了。

关于ravendb - 鉴于这些要求,我如何为该文档构建我的 RavenDb 静态索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9961882/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com