Search these areas:
Support Forums
Product Info

DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Data Analysis
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
New Responsive UI Module

DataWeb Help
Support Forums
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

Return Search Results
The final step in implementing full-text search in your application is writing script to return the search results.

Once the search index has been build, you can access the results of a particular search by creating a resultset on the ~search table. The ~search table is a special table that contains only search results; it is not visible in the web directory of your application. You can use the data in the resultset to construct a results page.

To create the resultset, use script like the following:

var rs = new Resultset("~search", "*", {query:q});

where q is a string variable containing the search text.

The following table shows the columns returned on the resultset:

Column Description
Catalog The catalog that includes this search result.
Abstract The summary text for the search result. The abstractfield attribute in the search specification file contributes this value.
Rank The position in the search field at which the search text was found.
Relevance A percentage rating for a particular document, in terms of its likely relevance. 
Title The title for the search result, as specified in the search specification.
URL The URL for this search result, constructed from the search specification.

The following function takes a search string, performs a search, and displays the results. You can use this function as a simple test for your search index. Paste the function into a DataWeb script (.ws) file, and click the Test button to test it: 

webcall function testSearchIndex(szQuery)
  var rs = new Resultset("~search", "*", {query:szQuery});
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
Email Us