Поделиться через


SPSearchResult Class

The SPSearchResult class represents the item returned as a result of a search performed on a list, document library, or site.

System.Object

   Microsoft.SharePoint.SPSearchResult

Public Properties

The following table shows the public properties of the SPSearchResult class, the data type of each property, and a brief description of each.

Name Data Type Description
DateLastModified System.DateTime Gets the time stamp that indicates when the item was last modified.
IconUrl String Gets the URL of the icon corresponding to the item.
ListName String Gets the name of the list that contains the item.
ModifiedBy String Gets the name of the user who last modified the item specified by title.
ModifiedByUrl String Gets the name of the user who last modified the item specified by the URL of its display form.
Size Int32 Gets the size of the item if it is a file in a document library.
Title String Gets the display name for the item.
Url String Gets the URL of the display form for the item.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Remarks

Use of this class and its members requires that Microsoft SQL Server be installed on the server and that you enable full-text search in SharePoint Central Administration.

Use one of the SearchListItems methods or one of the SearchDocuments methods of the SPWeb class to perform a search on a list or a document library and return a collection of search results. Use an indexer to return a single item from a collection of search results. For example, if the collection is assigned to a variable named mySearchResults, use mySearchResults[index] in C#, or mySearchResults(index) in Visual Basic .NET, where index is the index number of the search result in the collection.

Requirements

Namespace: Microsoft.SharePoint

Platforms: Microsoft Windows Server 2003

Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security