NexJ Logo

Finance full-text search (finance-text)

Project: finance-text

Name: Finance full-text search

Module/Namespace: text

Model namespace: nexj:model:finance-text

Target: finance

This project provides a full text search module (domain model and portal UI) for finance. This comes complete with the ability to search across types of classes and even into attachments while respecting security and visibility rules.

Syntax

Syntax for a full-text search is simple. The search can look for any combination of words, and uses and, or and not operators, as well as parentheses to control the order of operations.

The order of operations is the typical order for logical expressions, specifically:

  1. Contents of parentheses
  2. not operations
  3. and operations
  4. or operations

Syntax notes

All searches are case-insensitive.

Spaces between words are treated as and operations. So, for example, a search for tim lamont is the same as one for tim and lamont.

Note: Without parentheses, the not operator only applies to the word immediately following it, not to the longer “anded” string. See the examples for illustrations of this.

Examples

Use of parentheses

(tim or peter) Lamont

Returns all references to tim or peter that also include a reference to lamont. So, in the NexJ sample data, this search returns the records of Tim Lamont and Peter Lamont. in our sample data, we would be getting back references to Tim Lamont and Peter Lamont. Another way of writing the same query is:

tim lamont or peter lamont

Use of the not operator

tim not apple

Returns all values that contain the string tim, but that do not have the string apple included in them. For example, in the NexJ sample data, both Tim Lamont and Tim Cook are returned.

Some finer points:

tim not apple lamont

This will return both Tim Lamont and Tim Cook since the not operator only applies to apple.

tim not (apple lamont)

will also return Tim Lamont since the filter will omit only those Tim entries with both a lamont and apple in their values.

To fully omit all apples and all lamonts, write either of:

tim and (not apple not lamont)
tim and not (apple or lamont)

Setup

Prerequisites

Ensure that you have installed the “Full-Text and Semantic Extractions for Search” feature if you are running MSSQL

Setup instructions

  1. Run \etc\db<adapter><adapter>_create_fts_catalog.sql against your finance database to create a full text catalog.
  2. Add the finance-text project to the finance project as a mixin.
  3. Upgrade your database by running SysUpgrade. This creates the text indexing tables.
  4. After SysUpgrade completes, reload the database. This creates the initial text index snapshot.

To recreate that database at any time, run the recreate command in the Data Load tool.

Additional instructions for the enabling attachment search

NJAttachmentData does not currently get added to the index catalog as part of upgrade/recreate. To add NJAttachmentsData to the catalog manually:
1. Open the Management Console.
2. Go to the specific database (in Management console).
3. In the Storage menu, select Full Text catalogs.
4. Double click ftscatalog and select Select a page > Tables/Views.
5. Find NJAttachmentData in the Object Name list.
6. Select add from left to right.
7. Check the data column and set the Data Type Column to text_extension

Filter Setup

Each filter is specific to a given document type, such as .doc, .pdf, .xml and so on.

To check the list of filters installed on your server run the following query against your database: EXEC sp_help_fulltext_system_components 'filter';.

You may notice that the .pdf filter is not installed. If not, You can download Adobe PDF iFilter (64 bits) from here and run the installer.

To set up the filters, ensure that you are logged into the Management Studio with ‘sa’ privileges, and run the following commands:

EXEC sp_fulltext_service @action='load_os_resources', @value=1;
EXEC sp_fulltext_service 'update_languages';
EXEC sp_fulltext_service 'restart_all_fdhosts';

To confirm this worked, run EXEC sp_help_fulltext_system_components 'filter'; and look for .pdf in the component name, with a manufacturer of Adobe Systems, Inc..

If you are interested in the source documents on adding filters, see the following two articles from microsoft.com: :
* Configure and Manage Filters for Search
* Update the database server with the list of filters in sections 4, 5, and 6 of View or Change Registered Filters and Word Breakers