SearchDocumentWithData

This call is used to search documents on the basis of the given criteria and returns the list of the documents along with the dataclass and the data field values.

 

Public Function SearchDocumentWithData(FolderList() As Long, ByVal IncludeSubFolders As String, DocumentProp() As Byte, ByVal CreationDateRange As String, ByVal AccessedDateRange As String, ByVal RevisedDateRange As String, ByVal ExpirydateRange As String, ByVal SearchonKeyword As String, ByRef KeywordList() As String, ByVal AliasAlso As String, ByVal SearchOnDD As String, ByRef DDCriteria() As Byte, ByVal SearchOnGlobalId As String, ByRef GlobalIdCriteria() As Byte, ByVal SearchOnAnnotation As String, ByVal sAnnotText As String, ByVal SearchOnFullText As String, _
ByVal FTSSearchType As String, ByVal FTSBaseWord As String, ByVal FTSInflectionalFlag As String, FTSCriteria() As TagFTSSearch, ByVal SearchScope As Integer, ByVal DataDefCount As Long, ByRef DataDefList() As Long, ByVal DocRefFlag As String, ByVal sOrderBy As String, ByVal PrevDocCount As Long, PrevDocList() As Byte, DocumentCount As Long, DocListWithProp() As Byte, ByVal FetchCount, ByVal StartPos, ByRef TotalRecCount As Long, ByVal bDDDataReq As String, DataDefFieldCount() As Long, DataDefFields() As Byte, ByVal bIndexDataReq As String, IndexCount() As Long, IndexList() As Byte, ByVal bKeywordsReq As String, KeywordsCount() As Long, KeywordAlias() As Byte, ByVal bAliasReq As String) As Long

 

Parameters

In/out

Name

Data type

Description

In/Out

FolderList

Long

Array of folder indexes within which search of documents is to be performed

In

IncludeSubFolders

String

Whether subfolders are to be included in the search or not

In/Out

DocumentProp

Byte

Document properties

In

 

CreationDateRange

String

Creation Date range search criteria

In

 

AccessedDateRange

String

Accesed Date range search criteria

In

 

ReviseddateRange

String

Revised date range search criteria

In

 

ExpirydateRange

String

Expiry date range search criteria

In

 

SearchonKeyWord

String

Whether to search on keywords

In/Out

 

KeywordList

String

List of keywords for search as an array of string

In

 

 AliasAlso

String

Whether to search on aliases also

In

 

SearchOnDD

String

Whether to search on dataclass 'Y'/'N'

In/Out

 

DDCriteria

Byte[TAGDDSEARCHEX]

Data class specific details on which search is to be performed

In

 

SearchOnGlobalId

String

Whether to search on global index Y'/'N'

In/Out

 

GlobalIdCriteria

Byte[TAGINDEXSEARCH]

Global index information on which search is to be performed

In

 

SearchOnAnnotation

String

Whether to search on annotation 'Y'/'N'

In

 

sAnnotText

String

Annotation list

In

 

SearchOnFullText

String

Whether to perform full text search or not

In

 

FTSSearchType

String

Full text search type

In

 

FTSBaseWord

String

Base word for search

In

 

FTSInflectionalFlag

String

 

In/Out

 

FTSCriteria

TagFTSSearch

Full text search criteria in the form of structure of type 'TagFTSSearch'

In

 

SearchScope

Integer

Scope of search

0 - for new search

1- Append to existing search

2- Search in existing list

In

 

DataDefCount  

Long

Number of dataclass on which fetch is desired

In/Out

 

DataDefList

Long

Array of dataclasses indexes that are to be included in the search criteria

In

 

DocRefFlag

String

If references have to be fetched in the search result

'D' for only documents

'R' for only references

'B' for both reference and documents

In

 

sOrderBy

String

The order in which the search result is desired

In

 

PrevDocCount  

Long

Document count fetched till previous call

In/Out

PrevDocList

Long

List of fetched documents till previous call in the form of byte array 

Out  

DocumentCount

Long

Number of documents fetched

Out

 

DocListWithProp

Byte[tagDocument]

List of all documents fetched along with their corresponding attributes in the form of byte arrray

In

FetchCount

 Long

Fetch count in case batching is to be implemented

In  

StartPos

Long

Starting position for performing search

Out  

TotalRecCount

Long

Total document count retrieved in the search

In

bDDDataReq

String

Whether dataclass related info has to be fetched along in the search result.

Out

DataDefFieldCount

Long

Array of field count corresponding to each dataclass

Out

 

DataDefFields

Byte[TagDataDefField]

Dataclass field info corresponding to each dataclass in the form of a byte array.

In

 

bIndexDataReq

String

Whether global index related info has to be fetched along in the search result.

Out

 

IndexCount

Long

Array of global index count

Out

IndexList

Byte[TagIndex]

Global Index info in the form of a byte array.

In

 

bKeywordsReq

String

Whether keywords associated with each document is to be fetched or not

Out

KeyWordCount

Long

Array of keyword count for each document fetched

Out

KeyWordAlias

Byte[TagKeywordAlias]

List of keyword aliases for each document fetched

In

bAliasReq

String

Whether aliases for keywords have to fetched in the search or not

 

Description

This function is called in both local and shared cabinet for document search according to the search criteria. Result comprises of document list along with the associated dataclass and global index information.

 

Return value

Name

Description

 1

In case of success

-1

Invalid cabinet name

-3

Cabinet not connected

-201

Insufficient rights for the current operation

-133

User not logged in

 

Example

Dim lFolderId()                         As Long
Dim DocumentProp()                As Byte
Dim udtDocument                    As TagDocument
Dim sKeywordList()                  As String
Dim DDCriteria()                      As Byte
Dim udtDDCriteria                    As TAGDDSEARCH
Dim GlobalIdList()                    As Byte
Dim SearchOnGlobalId             As String
Dim udtGlobalId                       As TAGINDEXSEARCH
Dim udtTagFTSSearch()            As TagFTSSearch
Dim lDataDefList()                     As Long
Dim bPrevDocList()                   As Byte
Dim lFetchCount                       As Long
Dim lDocumentCount                 As Long
Dim lTotalRecCount                   As Long
Dim SearchOnDD                        As String
Dim ResultList()                           As Byte
Dim lRetVal                                 As Long
Dim sFTSInclude                         As String
Dim sFTSSearchType                  As String
Dim ldatadefindex                        As Long
Dim laDDDefFieldCount()             As Long
Dim btDDDefFields()                   As Byte
Dim lIndexCount()                       As Long 

Dim lKeyWordCount()                 As Long
Dim btKeyWordAlias()                As Byte
Dim udtkeyWord                        As TagKeyword
Dim udtDDField                         As TagDataDefField
Dim ldatadefcnt                         As Long
Dim lkeywordcnt                        As Long
Dim gPDb                                 As PanDb.pdbCls


Set gPDb = New PanDb.pdbCls


lKeywordpos = 0

IncSubFolder = "Y"

AliasAlso  = "N"


ReDim lFolderId(0)
lFolderId(0) = 0

ReDim DocumentProp(Len(udtDocument) - 1)

SearchOnKeyword = "Y"
ReDim sKeywordList(0)
sKeywordList(0) = "Important"

 

ldatadefindex = 2

ReDim lDataDefList(0)
lDataDefList(0) = 1
DataDefCount = 1
ReDim DDCriteria(Len(udtDDCriteria) - 1)

udtDDCriteria.Name = "Nikesh"
udtDDCriteria.Condition = "="
udtDDCriteria.DDId = 2

udtDDCriteria.IndexId = 3

udtDDCriteria.IndexType = 50 

udtDDCriteria.JoinCondition = "AND"
Call CopyMemory(DDCriteria(0) , udtDDCriteria, Len(udtDDCriteria))
SearchOnDD = "Y"

SearchOnGlobalId = "Y"
ReDim GlobalIdList(Len(udtGlobalId) - 1)

udtGlobalId.Condition = "="
udtGlobalId.IndexId = 11
udtGlobalId.JoinCondition = "AND"

udtGlobalId.Value = 1
udtGlobalId.IndexType = 3

Call CopyMemory(GlobalIdList(0), udtGlobalId, Len(udtGlobalId))

sFTSInclude = "Y"
sFTSSearchType = "ALLWORDS"
ReDim udtTagFTSSearch(0)
udtTagFTSSearch(0).sCondition = ""
udtTagFTSSearch(0).sKeyword = "Remarks"


CreateDateRG = ""
AccessDateRG = ""

ReviseDateRG = ""

ExpDateRG = ""
lFetchCount = 10

StartPos = 0

SearchScope = 0

DocRefFlag = "D" ' only document type

OrderBy = "N'' for sorting on names


lRetVal = gpdb.SearchDocumentwithData(lFolderId, IncSubFolder, DocumentProp, CreateDateRG, AccessDateRG, _
ReviseDateRG, ExpDateRG, SearchOnKeyword, sKeywordList, AliasAlso, SearchOnDD, DDCriteria, _
SearchOnGlobalId, GlobalIdList, "N", "", "N", sFTSSearchType, "", "", udtTagFTSSearch, SearchScope, _
DataDefCount, lDataDefList, DocRefFlag, OrderBy, 0, bPrevDocList, lDocumentCount, ResultList, _
lFetchCount, StartPos, lTotalRecCount, "Y", laDDDefFieldCount, btDDDefFields, "Y", lIndexCount, btIndexes, _
"Y", lKeyWordCount, btKeyWordAlias, "Y")

If lRetVal <> 1 Then

    msgbox gpdb.ErrDescription,vbinformation

End If