Search these areas:
Help
Support Forums
Product Info



Introduction
DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Views
Templates
Components
Data Analysis
Members
Security
Importing
Exporting
FTP
JavaScript
Object Model
Full-Text Search
-Tips for Searching
-Using the Search Module
-Define Search Catalogs
-Generate Search Index
-Return Search Results
Domain and Email Hosting
HotBlock Modules
Account Management
Glossary
New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

Define Search Catalogs
The first step in implementing full-text search in your application is constructing the search specification. The DataWeb engine uses the search specification to build the full-text search index.

You can specify which tables in your web application you want to search in your search specification. The search specification is a file named search.xml, which resides in the /system/search folder in your application. The search module will create and maintain this file for you; you can also create and edit it yourself, as described in the following section.

Define the catalogs to index
A catalog defines a set of records to be indexed for full-text search. You can index the data in an entire table, or specify a subset of records or fields in the table to be indexed. You must add a catalog to the search specification for each table that you want to index. Within a catalog, you can use XML tags and attributes to specify which fields and records to index.

The following table describes the XML tags and attributes that you can use to define your search specification:

XML Tag Attributes Parent Description
index     Encapsulates the search specification. Required.
catalog    index Defines a set of data to be indexed. Required.
  name   The name for the catalog. Required.
datasource   catalog Specifies the table on which this catalog is based. 
  datatable   The name of the table. Required.
  titlefield   The field to use for the title of the search result. Recommended.
  abstractfield   The field to use for the summary portion of the search result. Recommended.
  keyfield   The field to use for the value of the name-value pair in the URL of the search result. Optional. If omitted, the value of the primary key field is used.
field   datasource Specifies a field from this table to include in the search index. Recommended.
  name   The name of the field to index. Required.
  expr   The expression for a calculated field. Optional.
filter   datasource Defines a filter for the table to be indexed. Optional. Use standard SQL-compatible syntax to specify filter criteria.
displayview   catalog Specifies which view to use to display in the URL for search results on this catalog. Optional.
  href   The view to use to construct the URL in the search result. Optional. If omitted, the default view in the data folder containing the table is used.  
  param   The field to use for the name portion of the name-value pair in the URL of the search result. Optional. If omitted, the name of the primary key field is used.


Below is an example of a search.xml file with multiple catalogs defined.

<index>
  <catalog name="Customer">
  <displayview href="/Customers/default.view?_mode=details" param="customerid" />
  <datasource datatable="Customers" abstractfield="companyname" key="customerid">
   <field name="CompanyName" />
   <field name="ContactName" />
   <field name="ContactTitle" />
   <field name="City" />
   <field name="Country" />
   <filter><!-- customerid > "D" --></filter>
  </datasource>
</catalog>

 <catalog name="Employees">
  <datasource datatable="Employees" titlefield="LastName" abstractfield="Title">
   <field name="FirstName" />
   <field name="LastName" />
   <field name="Title" />
   <field name="City" />
   <field name="Country" />
  </datasource>
 </catalog>

 <catalog name="Products">
  <displayview href="/Products/product.view?_mode=update" />
  <datasource datatable="Products" titlefield="Title">
   <field name="Title" expr="=[CategoryID:CategoryName] + ' -- ' + [ProductName]" />
   <field name="ProductName" />
   <field name="CategoryID:CategoryName" />
  </datasource>
 </catalog>
</index>

Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
DataWeb, 720 North 10th Street, A #145, Renton, Washington 98057 *425-583-5970* Fax 484-770-4706* Email Us