Solved

FTSearch does not return the correct document

Posted on 2002-06-28
8
513 Views
Last Modified: 2013-12-18
I have an agent that asks the user to select a document in a list. The list displays the field "Description" of each document available.

After, it peforms an FTSearch to get that document from the same view that was used to build the list.

Say that there are 10 documents to choose from and one of them have the description "Doc 1" and another is "Doc 2". Sometimes when the user selects "Doc 2" it will find the document "Doc 1".

I can't figure out when this happens because somethimes it works correctly and sometimes not.

I tought it was because the user copied "Doc 1" and renamed the copy to "Doc 2". But I tested that and it seems to work.

I also tought it would be because my view was not sorted, so I sorted the description ascending and the error still occured

My view is hidden and contains 2 columns: Description and Structure (In that order)

None of the documents have the same description.

Here is my agent:
Sub Initialize
     Dim View As NotesView
     Dim Template As NotesDocument
     Dim ws As New NotesUIWorkSpace
     Dim s As String
     Dim Session As New NotesSession
     Set db = session.CurrentDatabase
     Set View = db.GetView("vTemplate")    
     
     s = ws.Prompt(PROMPT_OKCANCELLIST,"Choice","Choose a template:",,Evaluate("@DbColumn(''; ''; '(LookupTemplate)'; 1)"))
     If Trim(s) <> "" Then
          s = Chr(34) & s & Chr(34)
          view.FTSearch s,1    
          Set Template = View.GetFirstDocument
          Msgbox Template.Structure(0)
     End If
End Sub

Thanks in advance
0
Comment
Question by:Pennywisdom
  • 4
  • 3
8 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 7116618
Try updating FT index of the database.

Secondly, instead of this line

s = Chr(34) & s & Chr(34)


use this

s = |"| + s + |"|     ' WHich will be equivalent to "s"



~Hemanth
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 7116622
also replace 1 with 0 in ftsearch
0
 

Author Comment

by:Pennywisdom
ID: 7116695
Thanks for your reply ~Hemanth.

The help says that NotesDatabase.UpdateFTIndex will create an index only on a local database.

My database is on a server so "db.UpdateFTIndex True" gives me an error.
"db.UpdateFTIndex False" does not give me an error but db.IsFTIndexed still returns false after.
Does this mean that it's not working? Or is it normal?
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 200 total points
ID: 7116827
Well it depends on what level of access that you have,you should have atleast designer access to create index.

This can be created manually a one time setup. No need to drive it thru script.

Goto Database..Properties and click on lens icon (Full Text tab), and click on create index.

0
 
LVL 10

Expert Comment

by:zvonko
ID: 7116835
Hello PW,

this note in Help does only concern databases that do NOT have a FT index and a new FT index has to be created.
To verify that "Call db.UpdateFTIndex(False)" is working correctly test this:
1.) Set FT Update Frequency from Immediate to Daly.
2.) Add a document containing a new string combination.
3.) Search in Notes client for this string (should not hit).
4.) Run your agent containing: db.UpdateFTIndex(False)
5.) Search again in Notes client and you will see that FT index was updated.

Regards,
zvonko

0
 

Author Comment

by:Pennywisdom
ID: 7116865
Ok I created the index like Hemantha told me to.

I'll test this and let you know the results has soon as I can.
0
 

Author Comment

by:Pennywisdom
ID: 7143351
Thanks! Seems like indexing did the trick.

Sorry for the delay but I had to make sure it was working since it didn't always bug.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 7143426
Anytime
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question