Searching for documents in a docbase
Using queries to search for specific documents in a document base.
IxiaDocBaseServices docbase = ...
An application searches for documents in a docbase by using a query. The query contains search specifications coded in the TEXTML Query Language. These specifications can refer to the content (i.e., the indexed content) of the documents, to the properties of the document, to custom properties of the document, or to any combination.
Here is a simple but very useful query: AllSystemDocuments.xml
returns all the system documents in a docbase:
<?xml version="1.0" encoding="UTF-16"?>
<!-- AllSystemDocuments.xml -->
<query VERSION="4.5" RESULTSPACE="AllSystemDocuments">
<property NAME="DocType">
<elem>TEXTML_SYSTEM_DOCUMENT</elem>
</property>
</query>
As you can see, the TEXTML Query Language is coded in XML. Since there are two kinds of queries (Document queries and Indexed value queries) there are two DTDs for queries: SEARCH_DOCUMENTS.DTD and SEARCH_INDEX.DTD. The above query will retrieve these DTD files, as well as all other system documents, for a specified document base.
The programming logic to search for documents is essentially the same for any query.
To search for documents in a docbase:
Sample program and sample queries
AllSystemDocuments.xml
and the other
sample queries are located in your Program Files directory for TEXTML Server: [...]\IxiaSoft\TextmlServer[version]\SDK\Queries\*.xml.
Here is the sample program for running document queries: [...]\IxiaSoft\TextmlServer[version]\SDK\java\com\ixiasoft\samples\SearchDocuments.java.