Solved

FTSearch does not return the correct document

Posted on 2002-06-28
8
511 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
Comment Utility
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
Comment Utility
also replace 1 with 0 in ftsearch
0
 

Author Comment

by:Pennywisdom
Comment Utility
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
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 200 total points
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 10

Expert Comment

by:zvonko
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Anytime
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now