Case Study: Building "Book Catalog"

In this example we're going to create simple search interface for a catalog of Java books. Our catalog consists of a bunch of files, where one HTML file describes one item from the catalog. (Sample files can be found in <QuestAgent>/doc/samples/javabook directory.)

We'll provide that catalog is searchable by book description, author, publisher, and publication date. In addition, for every book in our catalog we need to save (and later show) informations about the author, publisher, ISBN number, price, number of pages, etc.

 

Step 1: Add Meta tags to your HTML Documents

Add appropriate Meta tags to every HTML page in catalog. For example:

  <html>
  <head>
  <title>Concurrent Programming in Java </title>

  <META NAME="Author" CONTENT="Doug Lea">
  <META NAME="Publisher" CONTENT="Addison Wesley">
  <META NAME="PublicationDate" CONTENT="October 1996">
  <META NAME="ISBN" CONTENT="0201695812">
  <META NAME="Pages" CONTENT="339">
  <META NAME="Price" CONTENT="$39.76">
  <META NAME="Description" CONTENT="This book provides you with detailed information and expert techniques that will enable you to exploit
  the many advantages of concurrent programming and create multi-threaded Java applications that are
  more responsive to user demands, faster, and more easily controlled.">

  </head>
  <body>
  ...
  </body>
  </html>

Step 2: Create New Index Profile

Create new index profile. Already made profile for this example can be found in directory <QuestAgent>/doc/samples.

Step 3: Define Data Field Mappings

These settings provide indexing of HTML body, keywords and description Meta tags in index field named "body." In addition, Meta tags for author, publisher and publication date will be indexed in separate index fields.

Step 4: Index Documents

Step 5: Deploy "Search by Field" Applet

Step 6: Edit "qagent.prm" File

Define searchable index fields. By default, all index fields are searchable but we'll ignore pubdate index here.

  collection1.field_order=body,author,publisher

Set appropriate field description.

  collection1.field.body.desc=Description
  collection1.field.author.desc=Author
  collection1.field.publisher.desc=Publisher

Define visible record fields (list columns):

  collection1.column_order=relevance,title,author,pages,price,publisher 

Step 7: Test Search Applet

Click here to open "Book Catalog" example.

 

One More Tip for the End

QuestAgent supports "location" record field changing simply specifying "location" Meta tag.

In our case that means we don't even need local documents which describes particular catalog items. Instead, the user could be sent directly to online ordering page for example. To achieve this, all you need to do is to add "location" Meta tag to your HTML documents. For example:

 <META NAME="Location" CONTENT="http://www.amazon.com/"> 

 

 

 


Copyright © 1997, 1999 JObjects - All right reserved.
contact@jobjects.com