CrawlPropertyをプログラムで「インデックスに含まれる」値を設定します(SharePoint 2007)

StackOverflow https://stackoverflow.com/questions/8924057

質問

独自のコンテンツソースを使用してSharePoint検索を開発しています。そして、私はクロールプロパティと管理されたプロパティとそれに応じてそれらの間のマッピングを持っています。また、私は動的特性を持っています。たとえば、ユーザーはプロパティのセットをrawうために変更することができるため、SharePoint Central Administrationから実行時にそれを作成します。私はそれを行うために次のコードを使用しています:

    private static void CreateProperty(string propertyName, Category category, ManagedPropertyCollection managedProperties)
    {
        var crawledProperty = category.CreateCrawledProperty(propertyName, false, Constants.CategoryId, 31);
        crawledProperty.IsMappedToContents = true;
        SetMapping(crawledProperty, managedProperties);
        crawledProperty.Update();
    }

    private static void SetMapping(CrawledProperty cProp, ManagedPropertyCollection managedProperties)
    {
        ManagedProperty mProp = managedProperties.Create(cProp.Name, ManagedDataType.Text);
        mProp.EnabledForScoping = true;
        Mapping newMapping = new Mapping(cProp.Propset, cProp.Name, cProp.VariantType, mProp.PID);
        MappingCollection mappings = mProp.GetMappings();
        mappings.Add(newMapping);
        mProp.SetMappings(mappings);
        mProp.EnabledForScoping = true;
    }

静的特性は、インストール中に追加され、動的特性は中央管理でマニュアルを追加します。同じコードを使用して、中央管理でマニュアルのインストールと設定中にプロパティを追加しています。

問題は、クロールプロパティのSharePointフラグ「インデックスに含まれる」の値です。場合、インストールが完了した場合、このフラグの値はすべての静的クロールプロパティに対して真(はい)です。それ以外の場合、動的特性の場合、このフラグは偽です(no)。 「インデックスに含まれる」フラグを常にチェックする必要があります。

私が知っているように、CrawlPropertyクラスのプロパティは「インデックスに含まれる」値に敏感ですが、私にとってはうまくいきません!

あなたはそれをするために何か考えがありますか?そして、私は間違って何をしていますか?

前もって感謝します。

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top