Click or drag to resize

IIQAPISearch Method

Execute an ad-hoc ImageQuest query to return a desired set of ImageQuest documents.

Namespace:  Informa.ImageQuest.API.Library
Assembly:  Informa.ImageQuest.API.Library (in Informa.ImageQuest.API.Library.dll) Version: 14.3.0.0
Syntax
List<IQDocument> Search(
	string token,
	string query,
	string keywords
)

Parameters

token
Type: SystemString
User Authentication Token from a previous Login(String, String, String) or SystemLogin(String) call.
query
Type: SystemString
Well-formed ImageQuest Query Language (IQQL) query specifying the index values to search for.
keywords
Type: SystemString
Set of full text search keywords to include in the search.

Return Value

Type: ListIQDocument
Array of IQDocument objects representing the ImageQuest documents that matched the supplied criteria.
Remarks

The Search(String, String, String) method is documented as returning a generic ListT containing IQDocument objects. In most cases, the SOAP proxy class generator will serialize this data as a fixed-length array.

ImageQuest searches performed via the API can be done using either the full text search feature, or using the index metadata via an IQQL query. See the ImageQuest API User's Guide for a full description of the IQQL syntax.

Examples
using ( IIQAPI api = new ImageQuestService.IQAPIClient() )
{
    string token = api.SystemLogin("ImageQuest");
    IQDocument[] documents = api.Search(token, "[DocumentType] = 'Invoice' AND [CustomerNumber] = '105-B'", String.Empty);
    foreach ( IQDocument document in documents ) 
    {
        List<IQDocumentAttribute> metadata = new List<IQDocumentAttribute>(document.Metadata);
        byte[] data = api.GetDocumentStream(token, document.Id);
        string fileName = String.Format("{0}_{1}_{2}.{3}", 
            metadata.Single(attribute => attribute.Name == "CustomerNumber").Value,
            metadata.Single(attribute => attribute.Name == "InvoiceNumber").Value,
            DateTime.Today.ToString("yyyyMMdd_hhmmss"),
            metadata.Single(attribute => attribute.Name == "FileType").Value
        );

        File.WriteAllBytes(fileName, data);
    }
}
See Also