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

Question

Question

Search results inconsistent between client and SDK

asked on December 21, 2016

I’ve been working on an application that leverages the Laserfiche SDK 8.3. Recently I’ve hit a roadblock trying to get search results from a particular folder through the SDK. More specifically, the results I get from a given search query are different between when I execute that query through the client and when I execute it through the SDK.

 

Here are the nitty-gritty details:

 

I have a folder in my repository called Records Retention, which contains three subfolders: College Bound, Passport, and State Need Grant. I’m interested in finding every document under that folder for which a certain template key has no value. Using Laserfiche’s native querying language, that query looks like this: {LF:LookIn="\Records Retention", Subfolders=y} & {[Receivables]:[Receivables Debt ID]=""}

 

The problem is that when I run this query in the LaserFiche client, it returns 23507 entries (all but <500 of them coming from the State Need Grant subfolder), which is precisely the number I expect; while running the same query using the SDK’s Search class returns only 344 results. What makes this number 344 especially interesting is that it’s precisely the number of results that would be returned if the query were only looking in the \Records Retention\College Bound folder.

 

I don’t make any changes to the default values of the Search class before calling the Run() method, and the only change I make to the default values of my SearchListingSettings before calling GetResultListing() is to add the System column. Are there other adjustments I need to make to these settings in order to get the results I expect? It really looks like the query looks through one subfolder and then stops. Please let me know if you have any insight into this issue.

 

Thanks

0 0

Answer

SELECTED ANSWER
replied on December 21, 2016

Are you connecting to the Laserfiche repository as the same user?  You can't accidentally limit your SDK search to a subfolder, but if the user running the search doesn't have access to the other location it could explain what you are seeing.

2 0
replied on December 21, 2016

That seems to be exactly what is happening! Now I just have to fix the permissions for this user and I can continue my work. Thank you!

0 0

Replies

replied on December 21, 2016

There shouldn't be any reason why the results would differ like that if you are using the exact same search phrase. The desktop client sets properties related to full-text search based on the user's settings, but those shouldn't affect this kind of search.  Are you using Laserfiche.RepositoryAccess or LFSO (I'm thinking RA because LFSO doesn't have the GetResultListing method)?

0 0
replied on April 18, 2019

I'm having a very similiar problem and am using the LFSO DLL.  I'm running a 10.3 server and the template/field search works find in the windows and web client, but finds fewer entries via my DLL using the LFSO DLL.

My DLL is running either the 80 or 90 LFSO.

 

 

 

0 0
replied on April 19, 2019

The most common mistake is that the searches are run by different users and security is what prevents results from being included.  If you're sure it's the same search query by the same user, then like Robbie says it's going to be some settings.  If you look at one of the entries that you're expecting, what is different about it?  Is it a shortcut?  Does the text not have an exact match (i.e. you need to do a fuzzy search)?

0 0
replied on April 19, 2019

I believe I ran into a shortcut / document search hit issue on my end. 

The client has "resolve shortcuts" ON.  I can tweak my SDK query and when I take off the phrase to remove shortcuts I now get what I expect...1 search hit.

Can you tell me, does the SDK use "resolve shortcuts" = ON also (the same settings as the client), a different setting, or always / never ?

Thanks !

0 0
replied on April 22, 2019

The SDK doesn't look at user settings or anything.  It sends exactly the query and parameters that your program passes to it, though of course parameters all have default values.  It's the low-level library that all applications use, so it needs to do exactly what the calling program requests.

0 0
replied on April 23, 2019

Thanks Brian.

Can you tell me, does the resolve shortcuts setting in the windows client apply to SDK searches also, or just to the windows client searches (for the logged in user or all users) ?

I'm trying to get a feel as to what "global" settings an SDK search is controlled by other than what my client passes it.  I don't see an SDK search setting called "resolve shortcuts"; perhaps it's named something different in the SDK ?

 

0 0
replied on April 23, 2019

User settings are an application-level concept and RepositoryAccess does not consult them, though I believe DocumentServices might.  The Search class has a property WillIncludeShortcuts that controls this behavior.

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

Sign in to reply to this post.