You are viewing limited content. For full access, please sign in.

Question

Question

What is the value of the Refresh property in SearchListingSettings class

asked on June 8, 2017 Show version history

I am writing a windows service that uses the Laserfiche RA SDK.  This service will kick off a process every night.  The process executes a search and does some processing against the documents returned in the search results.

It feels like there might be some value in setting the Refresh property to true since the search will be executed numerous times but the SDK documentation does not do a good explain of explaining the value of setting it to true or when it should be set to true.

When should the Refresh property be set to true? 

What is the effect of setting it to true?

What is the difference between running a search with the property set to true vs. false?

 

Here is my search code in case this might help understand what I am trying to do...

// A while statement here that returns true until someone stops the Windows service.
while (service has not been stopped)
{
    SearchListingSettings settings = new SearchListingSettings();
    settings.AddColumn(SystemColumn.Id);

    // Do I set this to true or false if I am running this code multiple times?
    settings.Refresh = true;  


    using (var search = new Search(session))
    {
        search.FuzzyType = FuzzyType.None;
        search.Command = "My search command"
        search.Run();

        using (var listing = search.GetResultListing(settings))
        {
            foreach (var row in listing)
            {
                var id = row.GetValue<int>(SystemColumn.Id);

                // Process document here                        
            }
        }
    }

     // A wait statement here (inside the while loop) that waits until 1:00am every day.
}

 

0 0

Answer

SELECTED ANSWER
replied on June 8, 2017

No, the Refresh flag should be set to False, unless you want to refresh the results of a previous search. It is for situations like for instance you have search results and some of the returned documents returned may have been moved since you obtained the results - like a workflow moved the documents to a different folder and the search result listing's path column would be incorrect. By setting the Refresh flag to True and calling GetResultListing again it will refresh the listing with the updated SystemColumn.Path information. It shouldn't result in the search being re-run. Maybe trace your loop to count the iterations. (And yes, I believe the SDK Refresh method text is incorrect).

2 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.