IAFSearch(T) Interface
- Last UpdatedNov 18, 2025
- 5 minute read
- PI System
- AF SDK 2024 R2
- Developer
Note: This API is now obsolete.

Namespace: OSIsoft.AF.Search
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
[ObsoleteAttribute("Use AFSearch<T> instead.")] public interface IAFSearch<T>
<ObsoleteAttribute("Use AFSearch<T> instead.")> Public Interface IAFSearch(Of T) Dim instance As IAFSearch(Of T)
[ObsoleteAttribute(L"Use AFSearch<T> instead.")] generic<typename T> public interface class IAFSearch
[<ObsoleteAttribute("Use AFSearch<T> instead.")>] type IAFSearch<'T> = interface end
Type Parameters
- T
- The type of object that is returned from the search class.
The IAFSearchT type exposes the following members.
Properties
| Name | Description | |
|---|---|---|
| CacheInterval |
The search's cached automatic refresh interval.
| |
| CacheTimeout |
The timeout to clean up the cached search in the server if it has not been used.
| |
| Database |
The AFDatabase to be searched by the query.
| |
| Identity |
This read-only property specifies the identity of the objects returned
from the search.
| |
| PISystem |
The PISystem to be searched by the query.
| |
| ThrowOnError |
Specifies it an exception will be thrown for missing objects or invalid data in the query.
| |
| Tokens |
The tokens that represent this search object.
|
Methods
| Name | Description | |
|---|---|---|
| FindObjectFields(String, Int32, Int32) |
This method will return the values as an IList for the specified fields for each of the objects
that match the search tokens.
| |
| FindObjectFieldsTObject(Int32, Int32) |
This method will return the values for the fields defined by the user-defined type for each of the objects
that match the search tokens.
| |
| FindObjectFieldsTObject(String, FuncIListObject, TObject, Int32, Int32) |
This method will return the values as an object for the specified fields for each of the objects
that match the search tokens using the supplied factory delegate.
| |
| FindObjectIds |
This method will return a list of the ID for each object that matches the
search tokens.
| |
| FindObjects |
This method will return the objects that match the search tokens.
| |
| GetTotalCount |
Returns the total count of the items that could be returned from the search query.
| |
| IsMatch |
Determines if the specified object matches the search query.
| |
| Refresh |
Refreshes the search that is cached in the server.
| |
| TryFindSearchToken |
Find the AFSearchToken associated with the specified AFSearchFilter.
| |
| TryFindSearchTokens |
Find the AFSearchToken list associated with the specified AFSearchFilter.
|
Remarks
This is a common generic interface to the properties and methods of the actual classes that implement the query based searches for objects. The QuerySearch feature can be checked to determine if query searches are supported.
A query string is parsed into search tokens which are used to specify the query filters for the search.
To optimize getting items from several pages of search results, a search can be cached by setting the CacheTimeout to a non-zero value. If you will only be getting items from the first page, then it is best to leave the cache disabled. The cache is disabled by default. Call the Refresh method to refresh the results of a cached search. Use the Close method to close a cached search when finished using it to free the memory used by the cached results in the server. Since the search implements the IDisposable interface, you can call the cached search in a using statement to automatically call the Close method when it leaves scope.
| When a query is too complex for a server, then you will get a NotSupportedException. |
Version Information
AFSDK
Supported in: 2.10.0, 2.10, 2.9.5, 2.9Obsolete (compiler warning) in 3.1.1
Obsolete (compiler warning) in 3.1.0
Obsolete (compiler warning) in 3.0.2
Obsolete (compiler warning) in 3.0.1
Obsolete (compiler warning) in 3.0.0
Obsolete (compiler warning) in 2.10.11
Obsolete (compiler warning) in 2.10.5