Cody,
The name of the fulltext field is the same one I listed in the URL integration: "DocuWareFulltext"
So, to call the RunQuery() method with more than one argument, I could do something like the following code that sets up variables and then makes the call:
Dialog dialog = <generate a Dialog object for the search dialog for the cabinet>;
List<DialogExpressionCondition> exprConditions = new List<DialogExpressionCondition>();
// *** NOTE *** Wild cards are allowed in expression conditions, emulating a SQL "LIKE".
exprConditions.Add(DialogExpressionCondition.Create("DocuWareFulltext", "the"));
exprConditions.Add(DialogExpressionCondition.Create("<OTHER_FIELD_NAME>", "<value to search for>"));
List<SortedField> sortFields = new List<SortedField>();
DocumentsQueryResult result = DWFuncs.RunQuery(dialog, exprConditions, sortFields, DialogExpressionOperation.And);
That would do an AND query on the two conditions, that fulltext contains the word "the" and that <OTHER_FIELD_NAME> equals "<value to search for>".
Now, you have a bit of a tricky situation. What you want to search for looks like:
((Guid = val1) OR (Guid = val2) OR (Guid = val3)...) AND (DocuWareFulltext = "<search term>")
As far as I know, this cannot be done. You cannot parenthesize a search in that way and mix your ANDs and ORs. If there is a way, I have not seen it. Even in some parts of DocuWare that allow free queries, using parentheses with regard to the Boolean conditions does not seem doable.
But there is good news. Remember, the DocumentsQueryResult (which is simply a collection of Document objects) is not a bulging mass of all the documents pulled down over the wire. It is just the header information for the documents returned. For example, in the query above when I did a full-text search on the word "the", I got back 1800 Document objects in about six seconds. It isn't as fast as doing straight SQL Server queries on regular indexes, but it is still quick. And each Document object can be checked quickly via a loop:
for (int i = 0; i < result.Items.Count; i++)
{
Document doc = result.Items[0];
string val = doc.Fields[3].Item.ToString();
}
Now, this means you have to know which field is which, ordinally (the object does not support named indexing). But if the Guid you are after is in, say, field 6 (zero-indexed), you could scan through all documents and find out which one has a field 6 that matches your list of Guids you are looking for.
In other words, lead with the fulltext search and then filter down from there. Because you can filter down further on the Guid -- you can't filter down further on full-text unless you find a way to pull down and decode the full-text on the query result. If you ever DID find a way to get the text back and do your own search, then you could do an OR query by guids at the start and then analyze those documents.
Like I said, though, DocuWare is pretty dang fast. So if you can lead with the full-text and let DocuWare run that query, that part of the filtering is done. If you don't have any full-text to search for, use an OR-based query with all the business guids joined together and just get all the documents back at once.
I do not know if any of this works in version 6.7 (we are on 6.11). But 6.7 (aka "platform Eagle") is still listed in the API help here:
http://help.docuware.com/sdk/platform-eagle/html/66b2ed1e-2aef-452a-97cd-5014bbf0242b.htm
so that is a good sign...
For completeness, here is my RunQuery() function that I have in namespace "DWFuncs":
==================================
public static DocumentsQueryResult RunQuery(Dialog dialog, List<DialogExpressionCondition> exprConditions, List<SortedField> sortFields = null, DialogExpressionOperation operation = DialogExpressionOperation.And)
{
// *** NOTE *** Wild cards are allowed in expression conditions, emulating a SQL "LIKE".
LastError = "";
if (dialog == null)
{
LastError = "Parameter 'dialog' cannot be null.";
return null;
}
if ((exprConditions == null) || (exprConditions.Count == 0))
{
LastError = "Parameter 'exprConditions' cannot be null or empty.";
return null;
}
DocumentsQueryResult queryResult = null;
try
{
DialogExpression queryExpr = new DialogExpression();
queryExpr.Count = int.MaxValue;
queryExpr.Operation = operation;
queryExpr.Condition = exprConditions;
if ((sortFields != null) && (sortFields.Count > 0))
{
queryExpr.SortOrder = sortFields;
}
else
{
// Sort field list is null or has no elements. So, use a default sort order for results.
queryExpr.SortOrder = new List<SortedField>();
queryExpr.SortOrder.Add(SortedField.Create("DWSTOREDATETIME"));
}
queryResult = dialog.Query.PostToDialogExpressionRelationForDocumentsQueryResult(queryExpr);
}
catch (Exception ex)
{
LastError = ex.Message;
queryResult = null;
}
return queryResult;
}
==================================
Hope this helps,
Joe Kaufman