M-Files API 23.11.13135.0
SearchCriteria Object
Members 
Description
The SearchCriteria class represents search conditions used in searches in Windows Explorer.
Public Methods
Creates a copy of the object.
Checks for equality to the specified search criteria.
Gets the effective search conditions of this search criteria. Can be directly used with searches.
Gets the effective search flags of this search criteria.
Public Properties
The additional conditions.
Specifies whether the search user interface is expanded.
The search refinements as a JSON string.
The first search condition.
The full-text search flags.
The full-text search string.
The object type search condition.
The search flags of the criteria.
Specifies whether the search within this folder flag is enabled.
The second search condition.
Remarks
Search criteria is a container object for the set of search conditions.
Example
' Create the view object.
Dim oViewNew As New MFilesAPI.View
oViewNew.Name = "Test view"

' Create the search criteria for the view.
Dim oSc As New MFilesAPI.SearchCriteria
oSc.FullTextSearchString = "demo*"
oSc.FullTextSearchFlags = MFilesAPI.MFFullTextSearchFlags.MFFullTextSearchFlagsStemming Or _
    MFilesAPI.MFFullTextSearchFlags.MFFullTextSearchFlagsLookInMetaData Or _
    MFilesAPI.MFFullTextSearchFlags.MFFullTextSearchFlagsLookInFileData Or _
    MFilesAPI.MFFullTextSearchFlags.MFFullTextSearchFlagsTypeAllWords
oSc.SearchFlags = MFilesAPI.MFSearchFlags.MFSearchFlagNone
oSc.ExpandUI = True

' Create the "not deleted" condition for search criteria.
Dim oExpression As New MFilesAPI.Expression
oExpression.DataStatusValueType = MFilesAPI.MFStatusType.MFStatusTypeDeleted
oExpression.DataStatusValueDataFunction = MFilesAPI.MFDataFunction.MFDataFunctionNoOp
Dim oTypedValue As New MFilesAPI.TypedValue
oTypedValue.SetValue(MFilesAPI.MFDataType.MFDatatypeBoolean, False)
Dim oDeletedEx As New MFilesAPI.SearchConditionEx
oDeletedEx.SearchCondition.Set(oExpression, MFilesAPI.MFConditionType.MFConditionTypeEqual, oTypedValue)
oDeletedEx.Enabled = True
oDeletedEx.Ignored = False
oDeletedEx.SpecialNULL = False

' Add the deleted condition.
oSc.AdditionalConditions.Add(-1, oDeletedEx)

' Add the new view.
oViewNew = oVault.ViewOperations.AddTemporarySearchView(oViewNew, oSc)


See Also

SearchCriteria Members