目前我正在使用属性袋,其中值是逗号分隔的东西:

web.AllProperties["fruits"] = "bananas, apples, oranges, tomatoes";
.

目前搜索是将它们视为一个搜索单词,我想知道我正在使用哪个分隔符,以便搜索使用它们作为单独搜索的单词,当索引时,或者以这种方式甚至可能?

有帮助吗?

解决方案

如果您有完整列表,则要搜索的不同类型的水果(或无论对象),那么您可以使用托管元数据并设置自定义术语。

其他提示

物业袋只是一个哈希表。您可以从数组开始并迭代它,以便为每个项目添加属性。然后添加水果的属性:

SPWeb web = SPContext.Current.Web;
web.AllowUnsafeUpdates = true;
$fruitsArray = @("fruit","bannana","apple","orange");
foreach ($i in $fruitsArray)
{
    web.AllProperties["MyFruitTerm" + [array]::IndexOf($fruitsArray,$i)] = $i;
    web.IndexedPropertyKey.Add($i);
}
web.Update();
web.AllowUnsafeUpdates = false;
.

许可以下: CC-BY-SA归因
scroll top