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

AF SDK Reference

AFAnalysis.FindAnalyses Method (AFDatabase, String, AFSearchField, AFSortField, AFSortOrder, Int32, Int32, Int32)

AFAnalysis.FindAnalyses Method (AFDatabase, String, AFSearchField, AFSortField, AFSortOrder, Int32, Int32, Int32)

  • Last UpdatedNov 18, 2025
  • 4 minute read
AFAnalysis.FindAnalyses Method (AFDatabase, String, AFSearchField, AFSortField, AFSortOrder, Int32, Int32, Int32)
Performs a paged search within the AFDatabase to retrieve a collection of AFAnalysis objects which have a field that match the specified query string.

Namespace:  OSIsoft.AF.Analysis
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static AFNamedCollectionList<AFAnalysis> FindAnalyses(
	AFDatabase database,
	string query,
	AFSearchField field,
	AFSortField sortField,
	AFSortOrder sortOrder,
	int startIndex,
	int maxCount,
	out int totalCount
)
Public Shared Function FindAnalyses ( 
	database As AFDatabase,
	query As String,
	field As AFSearchField,
	sortField As AFSortField,
	sortOrder As AFSortOrder,
	startIndex As Integer,
	maxCount As Integer,
	<OutAttribute> ByRef totalCount As Integer
) As AFNamedCollectionList(Of AFAnalysis)

Dim database As AFDatabase
Dim query As String
Dim field As AFSearchField
Dim sortField As AFSortField
Dim sortOrder As AFSortOrder
Dim startIndex As Integer
Dim maxCount As Integer
Dim totalCount As Integer
Dim returnValue As AFNamedCollectionList(Of AFAnalysis)

returnValue = AFAnalysis.FindAnalyses(database, 
	query, field, sortField, sortOrder, 
	startIndex, maxCount, totalCount)
public:
static AFNamedCollectionList<AFAnalysis^>^ FindAnalyses(
	AFDatabase^ database, 
	String^ query, 
	AFSearchField field, 
	AFSortField sortField, 
	AFSortOrder sortOrder, 
	int startIndex, 
	int maxCount, 
	[OutAttribute] int% totalCount
)
static member FindAnalyses : 
        database : AFDatabase * 
        query : string * 
        field : AFSearchField * 
        sortField : AFSortField * 
        sortOrder : AFSortOrder * 
        startIndex : int * 
        maxCount : int * 
        totalCount : int byref -> AFNamedCollectionList<AFAnalysis> 

Parameters

database
Type: OSIsoft.AFAFDatabase
The AFDatabase to search for the requested objects.
query
Type: SystemString
The query string used for finding objects.

The query string (or match pattern) can include regular characters and wildcard characters. Regular characters must match exactly the characters specified in the query string. Wildcard characters can be matched with arbitrary fragments of the query string. Wildcard characters can be escaped using the single backslash (\) character. Use a double backslash (\\) to match a single backslash. The syntax of the query string has the following rules:

  • If or empty string, then everything will be matched.
  • If no wildcards, then an exact match on the query string is performed.
  • Wildcard * can be placed anywhere in the query string and matches zero or more characters.
  • Wildcard ? can be placed anywhere in the query string and matches exactly one character.
  • One character in a set of characters are matched by placing them within [ ]. For example, a[bc] would match 'ab' or 'ac', but it would not match 'ad' or 'abd'.
  • One character in a set of characters are not matched by placing them within [! ]. For example, a[!bc] would match 'ad', but it would not match 'ab', 'ac', or 'abd'.
  • A character in a range of characters from first to last are matched using the following syntax: [first - last]. For example, a[a-c] would match 'aa', 'ab', or 'ac', but it would not match 'ad' or 'abc'.

field
Type: OSIsoft.AFAFSearchField
Specifies which of the object's properties are searched.
sortField
Type: OSIsoft.AFAFSortField
The field or property of the object used to sort the returned collection. This value should not be changed between calls when attempting to get the next page of items.
sortOrder
Type: OSIsoft.AFAFSortOrder
The order that the returned collection is sorted. This value should not be changed between calls when attempting to get the next page of items.
startIndex
Type: SystemInt32
The starting index (zero based) of the items to be returned.
maxCount
Type: SystemInt32
The maximum number of objects to be returned per call (the page size).
totalCount
Type: SystemInt32
The total number of objects that match the search criteria.

Return Value

Type: AFNamedCollectionListAFAnalysis
Returns the collection containing the specified page of AFAnalysis objects which match the specified query string.

Remarks

An object matches the search if the specified query is found in one of the object's properties specified by the field parameter.

Important note Important
Consider using the new AFAnalysisSearch class for finding analyses instead of using this method.

Version Information

AFSDK


See Also

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