ContentIterator.EnsureFieldIndexedEx method (SPList, String, Boolean)
Ensures that the SPField object is indexed for a SPList object.
Namespace: Microsoft.Office.Server.Utilities
Assembly: Microsoft.Office.Server (in Microsoft.Office.Server.dll)
Syntax
'Declaration
Public Shared Function EnsureFieldIndexedEx ( _
list As SPList, _
fieldName As String, _
deferIndexCreation As Boolean _
) As Nullable(Of Boolean)
'Usage
Dim list As SPList
Dim fieldName As String
Dim deferIndexCreation As Boolean
Dim returnValue As Nullable(Of Boolean)
returnValue = ContentIterator.EnsureFieldIndexedEx(list, _
fieldName, deferIndexCreation)
public static Nullable<bool> EnsureFieldIndexedEx(
SPList list,
string fieldName,
bool deferIndexCreation
)
Parameters
list
Type: Microsoft.SharePoint.SPListSPList.
fieldName
Type: System.StringA String object that represents the field name.
deferIndexCreation
Type: System.BooleanIf true, the index will only be created if the SPList is within 20% of the MaxItemsPerThrottledOperation property value. Otherwise, the index will always be created.
Return value
Type: System.Nullable<Boolean>
a null reference (Nothing in Visual Basic) if the field was already indexed; true if the field was previously not indexed but has now been indexed; false if the list was previously not indexed and has now been indexed, which is only possible for overloads of this method that defer index creation.
Returns Nullable<T>.
Remarks
The deferIndexCreation option is used to defer index creation until a list is large enough. This method is useful for indexing text columns, which block changing web collation after creation. Once an index needs to be created, it is far less likely to change the web collation.