Solved

FTSearch does not return the correct document

Posted on 2002-06-28
8
514 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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