Problem solve Get help with specific problems with your technologies, process and projects.

Inconsistent search results

I've been having inconsistent search results for some time now and I think I'm now finally able to predict its behavior. But I don't understand why!

When I submit a form (an agent is run), the document created can immediately be seen in a view. But, when I search for the document using its unique number, it can't be found. So, I open the document from the view then save it (a different agent is run here). And voila! When I search for the number again the document now appears out of thin air!

I call db.updateftindex in both agents so I don't understand why the document only appears when the latter agent is run. I also tried running both agents when the document is submitted for the first time -- but it doesn't work!

Do you have any clue what's happening here? Any help will be appreciated.

View member feedback to this Ask the Expert Q&A.

It's hard to be sure without seeing the application, but the issue might be the unique ID that you are using for the search. When a document is first created, it gets a temporary UNID. Once the document is saved for the first time, the permanent UNID is set and will never change. If you're getting the UNID when the document is first created, then saving the form, you won't be able to find it by that UNID, because it will have changed. Any code that is triggered by the new document will not be able to get the permanent ID when the document is first saved.

I had a similar situation in an application one time, so I added a Computed when Composed field called InitialUNID to the form and set it to @Text(@DocumentUniqueID). I then created a lookup view by the InitialUNID field, so that I could immediately look up the document by that value from the same piece of code that initially saved it. In your situation, you should be able to full-text search for the value, because it will now be stored in a field on the document.


In my experience there are always a few minutes delay before the full text index are updated by the server.

If one wants to find a document by its UNID it is much quicker to just call

If the key is a field with an unique ID the best way to find the document is by using a hidden view sorted by the key. Remember to call view.refresh before view.GetDocumentByKey( key,True).

—Tommy D.

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on Lotus Notes Domino Agents

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...