IBM FileNet P8, バージョン 5.2.1            

バックグラウンド検索結果の取得

以下の Java™ および C# のコード例は、CmAbstractSearchResult オブジェクトを取得することによってバックグラウンド検索結果を取得する方法を示しています。

Java の例

// Retrieve the CmAbstractSearchResult objects that are associated with the background search.
CmAbstractSearchResultSet objBkSearchResults = objBkSearch.get_SearchResults();

// Iterate search results.
Iterator iter = objBkSearchResults.iterator();
while (iter.hasNext())
{
    CmAbstractSearchResult objBkSearchResult = (CmAbstractSearchResult) iter.next();

    // Iterate properties of each search result.
    Properties props = objBkSearchResult.getProperties();
    Iterator iterProps = props.iterator();
    while (iterProps.hasNext() )
    {
        Property prop = (Property)iterProps.next();

        // Search for DocCreationDate property of each result object and print non-null values.
        if (prop.getPropertyName().equalsIgnoreCase("DocCreationDate"))
        {
            if ( prop.getObjectValue() != null )
                System.out.print("¥nDocCreationDate property value: " + prop.getObjectValue().toString());
        }
    }
}

C# の例

// Retrieve the CmAbstractSearchResult objects that are associated with the background search.
ICmAbstractSearchResultSet objBKSearchResults = objBkSearch.SearchResults;

// Iterate search results.
foreach (ICmAbstractSearchResult objBkSearchResult in objBKSearchResults)
{
    // Iterate properties of each search result.
    IProperties props = objBkSearchResult.Properties;
    foreach (IProperty prop in props)
    {
        // Search for DocCreationDate property of each result object and print non-null values.
        if (prop.GetPropertyName().Equals("DocCreationDate"))
        {
            if ( prop.GetObjectValue() != null)
                System.Console.Write("¥nDocCreationDate property value: " + prop.GetObjectValue().ToString());
        }
    }
}


最終更新日: 2015 年 10 月
backgroundsearch_snip4.htm

© Copyright IBM Corp. 2015.