Oracle Ultra Search Online Documentation
Release 9.2

Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback

Sample Crawler Agent README

Table of Contents

1. Introduction
2. Sample Agent Files
3. Setting up the Sample Crawler Agent

1. Introduction

Oracle Ultra Search provides a sample implementation of user-defined crawler agents using the Ultra Search agent API.Upon invocation, this sample agent connects to a specified Oracle database and retrieves the contents of a table for the crawler to collect and index.

The sample agents are fully functional and can be customized to adapt to other database-based data sources. This agent performs the following task:

For more information, see About the Ultra Searach Crawler Agent API.

2. Sample Agent Files

The sample agent files are located in the $ORACLE_HOME/ultrasearch/sample directory. You can directly view the sample agent source code using your preferred text editor.

The following table describes all sample agent files:

Sample Agent File

File Description
sample_agent_readme.htm This file
SampleAgent.java Sample crawler agent implementation using agent APIs

3. Setting up the Sample Crawler Agent

3.1 Compile and Build Agent Jar File

The Java source code for the sample agent must be first compiled into class files and put into a jar file in the $ORACLE_HOME/ultrasearch/lib/agent/ directory. The classes needed for compilation are the JDK class (classes.zip), Oracle JDBC thin driver (classes12.zip), and ultraserach.jar. For example:

   javac -J-ms16m -J-mx96m -O -classpath /jdk1.2.2_05/lib/classes.zip:/lib/classes12.zip:
   $ORACLE_HOME/ultrasearch/lib/ultrasearch.jar SampleAgent.java
 

To build the sampleAgent.jar file:

  /jdk1.2.2_05/bin/jar cv0f /oracle/ultrasearch/lib/agent/sampleAgent.jar 
  SampleAgent.class 'SampleAgent$DocNode.class'
 

3.2 Create a Data Source Type

A data source type that uses the sample agent must be created first.

3.3 Define Data Source Parameters

Define parameters for a data source type:

3.4 Define a Data Source of this Type

A data source is defined, which initializes the data source parameters. For example, the value specified accesses a table whose schema is:

    TABLE NEWS (
    ARTICLE_NO    NUMBER,
    NEWS_URL      VARCHAR2(740),
    TITLE         VARCHAR2(200),
    AUTHOR        VARCHAR2(100),
    PUB_DATE      DATE default SYSDATE,
    PUBLISHER     VARCHAR2(100),
    PRICE         NUMBER,
    LANG          VARCHAR2(10),
    IGNORE        NUMBER DEFAULT 0,
    PRIMARY KEY (NEWS_URL)
    );

Oracle
Copyright © 2002 Oracle Corporation.
All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback