“Query is not understandable” - Full text searching where field types have changed

后端 未结 2 2024
北荒
北荒 2021-01-27 23:59

A client have a long lived IBM Notes application where someone along the line changed the type of a field from number to text.

So, now when we\'re trying to do an FT sea

2条回答
  •  爱一瞬间的悲伤
    2021-01-28 00:44

    Links are useful, but if you don't want to remove data from documents - for me such steps worked (and there was no need in removing fields from forms in designer):

    • Run from designer with manager access with such code inside

      Sub Initialize  
      Dim s As New NotesSession
      Dim db As NotesDatabase
      Dim dc As NotesDocumentCollection
      Dim doc As NotesDocument
      Dim i As Integer
      Dim nc As NotesNoteCollection
      Dim noteid As String
      Dim nextnoteid As string
      Dim itemArr As Variant
      Dim NeedSave As Boolean
      
      Const ITEM_NAME = "itemName1|itemName2"
      
      itemArr = Split( ITEM_NAME, "|" )
      'погромист-кун не должен забывать про наличие итемов в формах...
      Set db = s.Currentdatabase  
      Set nc = db.CreateNoteCollection(False) 
      nc.SelectForms = true
      Call nc.BuildCollection
      noteid = nc.Getfirstnoteid()
      For i =  1 To nc.Count
          Set doc = db.Getdocumentbyid( noteid )
          noteid = nc.Getnextnoteid( noteid )
          NeedSave = false
          ForAll IA In itemArr
              If doc.Hasitem( IA ) Then
                  Call doc.Removeitem( IA )
                  NeedSave = true
              End If
          End ForAll
          If NeedSave Then
              Call doc.Save( True, False )
          End If
          Print CStr( i ) & "\" & CStr( nc.Count )
      Next    
      
      End Sub
      
    • Remove database index

    • Run from administrator command lo compact database.nsf -c , like mentioned in links above
    • Create index

提交回复
热议问题