Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tutorial walks through the steps necessary to crawl an RDBMS repository using the Aspire RDB connector via Snapshots.

Before Beginning: Create User Account

A prerequisite for crawling any RDBMS is to have an RDBMS account. The recommended name for this account is "aspire_crawl_account" or something similar.

The username and password for this account will be required below.


Step 1: Set RDBMS Access Rights

The "aspire_crawl_account" will need to have sufficient access rights to read all of the documents in the RDBMS that you wish to crawl.

To set the rights for your "aspire_crawl_account", do the following:

  1. Log into the RDBMS as an Administrator.
  2. Make the role of the "aspire_crawl_account" either administrator or superuser (so that it has access to all RDBMS content).

You will need this login information later in these procedures, when entering properties for your RDB Connector via Snapshots.

Step 2: Launch Aspire and open the Content Source Management Page



Aspire Content Source Management Page

Launch Aspire (if it's not already running). See:

Browse to: http://localhost:50505. For details on using the Aspire Content Source Management page, please refer to UI Introduction.


Image Added

Step 3: Install and Configure the RDB Connector via Snapshots Content Source into Aspire



Add new source

To specify exactly what RDBMS to crawl, we will need to create a new "Content Source".

To create a new content source:

  1. From the Aspire 2 Home page, click on "Add Source" button.
  2. Click on RDB Connector via Snapshots.

Step 3a: Specify Basic Information



General Configuration Tab

In the "General" tab in the Add New Content Source window, specify basic information for the content source:

  1. Enter a content source name in the "Name" field.

    This is any useful name which you decide is a good name for the source. It will be displayed in the content source page, in error messages, etc.

  2. Click on the "Active?" checkbox to add a checkmark.

    Unchecking the "Active?" option allows you to configure content sources but not have them enabled. This is useful if the folder will be under maintenance and no crawls are wanted during that period of time.

  3. Click on the "Schedule" drop-down list and select one of the following: Manually, Periodically, Daily, or Weekly.

    Aspire can automatically schedule content sources to be crawled on a set schedule, such as once a day, several times a week, or periodically (every N minutes or hours). For the purposes of this tutorial, you may want to select Manually and then set up a regular crawling schedule later.

  4. After selecting a Schedule type, specify the details, if applicable:
    1. Manually: No additional options.
    2. Periodically: Specify the "Run every:" options by entering the number of "hours" and "minutes."
    3. Daily: Specify the "Start time:" by clicking on the hours and minutes drop-down lists and selecting options.
    4. Weekly: Specify the "Start time:" by clicking on the hours and minutes drop-down lists and selecting options, then clicking on the day checkboxes to specify days of the week to run the crawl.
    5. Advance: Enter a custom CRON Expression (e.g. 0 0 0 ? * *)

Step 3b: Specify RDBMS Properties & Connection Details

In the "Connector" tab, specify the connection information to crawl the RDBMS

SQL Configuration

The connector uses a number of SQL statements to define what is exacted from the database when a crawl is run. In retrieve everything mode, a single statement is used to extract data. In retrieve data per batch mode, a number of statements are used. When data is extracted from the database, that data is put in to Aspire by column name. If you want is to appear by another name, use the SQL as operator in your select statements.

For the purposes of this tutorial, you'll need to understand the schema of your database and have access to a third party SQL client that will allow you to run SQL statements.

  1. In the "Retrieve everything" field, enter the full crawl SQL statement (refer to Full Crawl SQL for details).
  2. Leave the "Use slices?" checkbox unchecked for the purposes of this tutorial.

    Check this if you want to divide the Full crawl SQL into multiple slices.

Retrieve Everything SQL

The retrieve everything SQL statement is executed once when the "Retrieve everything" button is pressed. It should extract all the data you wish to be submitted to Aspire and can extract from one or more tables. In it's simplest form, it may look something like:

 SELECT
   id,
   col1,
   col2,
   col3,
   col4
 FROM
   main_data

This will result in an Aspire Job for each row returned, each comprising a document which hold fields named id, col1, col2, col3 and col4

Additional Information Configuration

The connector also needs to be told more information about the query result and how should behave while crawling.

  1. Set the ID Colum with the id obtained from the query, based on the query above it will be id.
  2. Check ID Column is a string if the id from the main_data table is a textual value instead of a numerical one.
  3. Check Index tables? if you want to index the table itself while crawling.

Database Connection

  1. On Advanced Connector Properties, check Advanced Configuration
  2. Check Specify Connector Defaults

  1. RDBMS Specific Properties

    In the "JDBC Url" field in the Properties section, enter the JDBC URL for the database to be crawled (refer to RDBMS URLs for details).
  2. Specify the username and password of the crawl account you created earlier.

    It needs sufficient access to crawl the RDBMS documents and folders in the path that you specified. Note: The password will be automatically encrypted by Aspire.

  3. In the "JDBC Driver Jar:" field, enter the name of the JAR file containing the driver for your database.
  4. In the "JDBC Driver Class" field, enter the Java class name for the driver.

    This is optional.

RDBMS URLs

An RDBMS "URL" is needed to tell the connector application what database to crawl. The exact form of this URL is dictated by the JDBC driver and therefore the database vendor, but will be of the form

 jdbc:<vendor>://<server>:<port>/<database>

For example

 jdbc:mysql://192.168.40.27/wikidb

See your database vendor's documentation for more information on JDBC URLs.

Step 3c: Specify Workflow Information



Workflow Configuration Tab

In the "Workflow" tab, specify the workflow steps for the jobs that come out of the crawl. Drag and drop rules to determine which steps should an item follow after being crawled. This rules could be where to publish the document or transformations needed on the data before sending it to a search engine. See Workflow for more information.

  1. For the purpose of this tutorial, drag and drop the Publish To File rule found under the Publishers tab to the onPublish Workflow tree.
    1. Specify a Name and Description for the Publisher.
    2. Click Add.

After completing this steps click on the Save button and you'll be sent back to the Home Page.

Image Added

Image Added

Image Added

Image Added

Step 4: Initiate the Full Crawl

Now that everything is set up, actually initiating the crawl is easy.

Start Crawl

Now that the content source is set up, the crawl can be initiated.

  1. Click on the crawl type option to set it as "Full" (is set as "Incremental" by default and the first time it'll work like a full crawl. After the first crawl, set it to "Incremental" to crawl for any changes done in the repository).
  2. Click on the Start button.

Note that content sources will be automatically initiated by the scheduler based on the schedule you specified for the content source, be it once a day, once a week, every hour, etc. But you can always start a crawl at any time by clicking on the "Full" button.

Be aware that Aspire will never initiate multiple simultaneous crawls on the same content source. Of course, multiple jobs may be crawling different content sources at the same time.

This means that you can click on "Full" or "Update" and not have to worry about the scheduler perhaps scheduling a crawl on the same content source. The scheduler will always check to see if the content source is actively crawling before starting its own crawl of that same content source.

During the Crawl



Crawl Statistics

During the crawl, you can do the following:

  • Click on the "Refresh" button on the Content Sources page to view the latest status of the crawl.

    The status will show RUNNING while the crawl is going, and CRAWLED when it is finished.

  • Click on "Complete" to view the number of documents crawled so far, the number of documents submitted, and the number of documents with errors.

If there are errors, you will get a clickable "Error" flag that will take you to a detailed error message page.

Step 5: Initiate an Incremental Crawl

If you only want to process content updates from the RDBMS (documents which are added, modified, or removed), then click on the "Update" button instead of the "Full" button. The RDB connector via Snapshots will automatically identify only changes which have occurred since the last crawl.

If this is the first time that the connector has crawled, the action of the "Update" button depends on the exact method of change discovery. It may perform the same action as a "Full" crawl crawling everything, or it may not crawl anything. Thereafter, the Update button will only crawl updates.

Scheduled crawls are always "Update" crawls. This means that the you may need to manually perform a "Full" crawl initially before using scheduled jobs after that to perform "update" crawls.

Statistics are reset for every crawl.

Image Added

Image Added