CreateIndex method (NotesDominoQuery - LotusScript)

Creates an index (Domino view) that is optimized for DQL query terms.

Defined in

NotesDominoQuery

Syntax

NotesDominoQuery CreateIndex(String IndexName, Variant Field, Optional Boolean Isvisible, Optional Boolean Nobuild)

Parameters

IndexName

String. The name of the index to create. Use a name that doesn't conflict with the name of an existing view.

Field

Variant string or string array. The name of the field to be indexed.

IsVisible

Boolean. Makes the view visible. If not specified, a hidden view is created using parentheses. For example, "myindex" becomes "(myindex)". If set to true, all users see the view created by the call when they open the database.

Nobuild

Boolean. Doesn't build the view, allowing for normal view processing to do so. All views created by CreateIndex are created with refresh options set to "Automatic". If not specified, the view created is built as part of the CreateIndex operation.

Return value

None.

Example

Dim IndexName As String
    Dim FieldName As Variant

    Dim Session As New NotesSession
    Dim db As NotesDatabase
    Dim TheQuery As NotesDominoQuery
    Set db = Session.CurrentDatabase
    Set TheQuery = db.Createdominoquery()
    IndexName = "idx1"
    FieldName = "order_status"
    ' Create the index, default the options
    Call TheQuery.CreateIndex(IndexName, FieldName)

Language cross-reference

createIndex method (DominoQuery - Java)