Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

IAFSearch(T) Interface

  • Last UpdatedNov 18, 2025
  • 5 minute read
IAFSearch(T) Interface

Note: This API is now obsolete.

This is a generic interface for the query-based search classes.

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

  NameDescription
Public property
CacheInterval
The search's cached automatic refresh interval.
Public property
CacheTimeout
The timeout to clean up the cached search in the server if it has not been used.
Public property
Database
The AFDatabase to be searched by the query.
Public property
Identity
This read-only property specifies the identity of the objects returned from the search.
Public property
PISystem
The PISystem to be searched by the query.
Public property
ThrowOnError
Specifies it an exception will be thrown for missing objects or invalid data in the query.
Public property
Tokens
The tokens that represent this search object.

Methods

  NameDescription
Public methodCode example
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.
Public methodCode example
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.
Public methodCode example
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.
Public methodCode example
FindObjectIds
This method will return a list of the ID for each object that matches the search tokens.
Public method
FindObjects
This method will return the objects that match the search tokens.
Public method
GetTotalCount
Returns the total count of the items that could be returned from the search query.
Public methodCode example
IsMatch
Determines if the specified object matches the search query.
Public method
Refresh
Refreshes the search that is cached in the server.
Public method
TryFindSearchToken
Find the AFSearchToken associated with the specified AFSearchFilter.
Public method
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.

Note Notes to Callers
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.9
Obsolete (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

See Also

TitleResults for “How to create a CRG?”Also Available in