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

Question

Question

RA code sample for searching all repository documents with a particular template/metadata field value

SDK
asked on March 20, 2014

Hi All,

 

I am new to the SDK and learn best by example.  I was wondering if someone could share a code sample for searching all entries in a repository for a particular metadata field value.  I'd like to gather up all the entries and stick them into a custom dictionary for later use.

 

I think once I understand the basics on how to search for things, I'll be on my way.

 

Any advice would be appreciated smiley

 

0 0

Replies

replied on March 20, 2014

Searching through RA has an example in the "Searching Documents" chapter in the SDK help. If you're looking for the advanced search syntax that would find documents by field values, see the help file. Another easy way to get the advanced search syntax for a given search is to add the Advanced Search panel to your search in the Client, then configure the fields and other search options you want. When you run the search, the Client automatically populates the Advanced Search panel with the syntax for it.

2 0
replied on April 21, 2014

I followed the advice as given to Joshua.

 

I figured out how to place the advanced search syntax, but I'm not having much luck locating the object that will reference the search criteria for review number or case number.

 

I've tried examining the options under settings.xxx and also the Field.xxx and not found a reference like those shown for other options.

 

For example I tried settings.AddColumn(Field.ReferenceEquals(currentrow(2))  but it is not correct, nor are other items.

(2))

Any idea what I'm overlooking ?

 

Regards,

Brian

 

currentrow(0) is the Document type (PDF, TIF)
currentrow(1) is the Case Number
currentrow(2) is the Review number
currentrow(3) is the path to place the file

 

My code snippet is as follows:

  
       Dim serverName As String = CMBLaserficheServerName.Text, repositoryName As String = CMBRepositoryName.Text
                            Dim userName As String = CMBLaserficheRepositoryUserLogin.Text, userPassword As String = CMBLaserficheRepositoryUserPassword.Text
                            Dim mySession As New Session
                            Dim listing As New List(Of String)
                            ' Logging into the Repository
                            mySession.LogIn(userName, userPassword, New RepositoryRegistration(serverName, repositoryName))
                            'This search is looking for any entry name ("*"),
                            ' only documents ("DB"), and the review and case numbers provided

                            ' by an external csv list.
                            Dim searchParameters As String = "{[]:[Case Number]=currentrow(1), [Review Number]=currentrow(2)} & {LF:Name=""*"", Type=""DB""}"
                            Dim lfSearch As Search = New Search(mySession, searchParameters)
                            Dim settings As SearchListingSettings = New SearchListingSettings
                            Dim searchResults As SearchResultListing
                            ' ** Dim targetFolder As String
                            Dim filePathAndName As String
                            ' What columns do you want the search to retrieve...
                            settings.AddColumn(SystemColumn.Name)
                            settings.AddColumn(SystemColumn.CreationDate)
                            settings.AddColumn(SystemColumn.EntryType)
                            settings.AddColumn(SystemColumn.Path)
                            settings.AddColumn(Field.ReferenceEquals(currentrow(2))
           

1 0
replied on March 21, 2014

Thank you very much!  It wasn't clear in the RA instructions that you could perform the advanced search syntax inside the search command (that sounds silly now while typing it).  I saw references to the advance syntax in the LFSO instructions, but I figured the RA API was using a different approach.  I was thinking I was going to have to perform some sort of filter after gathering up all the documents.  The SearchClientApp.cs example included with the SDK had exactly what I needed.

 

Thanks for helping me get started!

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

Sign in to reply to this post.