dtSearch Text Retrieval Engine Programmer's Reference
Example
Search Requests Overview

A web-based application is set up to search a collection of PDF files. The application must be able to provide full-text search using the "any words" query syntax, as well as date range searching. Additionally, users can enter keywords to search for in the "Author" and "Subject" fields of the PDF files. 

To implement this type of searching, the application would do the following:

  1. Store the user-entered search request in the Request member of the SearchJob.
  2. Set SearchJob.SearchFlags to dtsSearchAnyWords, specifying the query syntax of the request.
  3. Format the user's date range, if any, using the xfilter syntax, and store it in the FileConditions member of the SearchJob.
  4. If the user specified keywords for the Author or Subject fields, add them in the BooleanConditions member of the SearchJob.

For example, suppose a user is searching for a 2001 document on tax policy that concerns annuities and life insurance. The user fills out the search form as follows:

Search request:    +"life insurance" +annuities
Subject:           tax
Date:              January 2001 - December 2001

The application would set up a search as follows:

Request:           +"life insurance" +annuities
BooleanConditions: (Subject contains (tax))
FileConditions:    xfilter(date "M01/D01/Y2001~~M12/D31/Y2001")
You are here: Overviews > Search Requests > Search Requests Overview
Copyright (c) 1995-2008 dtSearch Corp. All rights reserved.