I wrote a c# code to search worksite documents. It works fine when I only provide one single parameter, however, if I provide more than one, it will return no result (result count=0). I would like to search either (author=srchKey) OR (fulltext=srchKey). I have been banging my head, could anyone please help? Thanks a lot.
Below is my code:
public List<iManageVO> RunSearch(string srchKey)
{
try
{
iManageSearch rds = new iManageSearch(isession);
// Populate searchparameters
IManProfileSearchParameters searchparams = Utility.CreateUnpopulatedProfileParams(idms);
// the code works, if there is only one searchparams, but if I un-comments one, it will return no result.
// i would like to search either author = srchKey OR Description = srchKey
//searchparams.Add(imProfileAttributeID.imProfileAuthor, srchKey);
//searchparams.Add(imProfileAttributeID.imProfileFullText, srchKey);
searchparams.Add(imProfileAttributeID.imProfileDocNum, srchKey);
//searchparams.Add(imProfileAttributeID.imProfileDescription, srchKey);
// Search documents
IManDocuments results = rds.GetDocuments(Utility.BuildDatabaseList(isession.Databases), searchparams);
List<iManageVO> foundDocuments = null;
// Check results
if (results != null)
{
foundDocuments = new List<iManageVO>();
strResult = "Search returned " + results.Count + " document(s).";
foreach (IManDocument document in results)
{
iManageVO doc = new iManageVO();
doc.Description = document.Description;
doc.Author = document.Author.FullName;
doc.DocId = document.Number;
doc.iManageNrl = document.ObjectID;
foundDocuments.Add(doc);
}
}
return foundDocuments;
}
catch (ApplicationException ae)
{
throw ae;
}
}