Examples: FTSearchScore property (NotesDocument - LotusScript®)

  1. This script performs a full-text search to filter the By Category view of the current database. It then gets the full-text search score of the first document in the view and puts it into the variable score. For example, FTSearchScore returns 80.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim view As NotesView
    Dim doc As NotesDocument
    Dim score As Integer    
    Set db = session.CurrentDatabase
    Set view = db.GetView( "By Category" )
    Call view.FTSearch( "blue", 0 )
    Set doc = view.GetFirstDocument
    score = doc.FTSearchScore
  2. This script performs a full-text search on the current database and places any document whose full-text search score is greater than 90 into a folder.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim collection As NotesDocumentCollection
    Dim doc As NotesDocument
    Set db = session.CurrentDatabase
    Set collection = db.FTSearch( "blue", 0 )
    Set doc = collection.GetFirstDocument()
    While Not(doc Is Nothing)
      If ( doc.FTSearchScore > 90 ) Then
        Call doc.PutInFolder( "Blue documents" )
        Set doc = collection.GetNextDocument(doc)
      End If
    Wend