Search:
www.rocket99.com : Technical Guides Sybase Oracle UNIX Javascript


Technical Guides
Sybase
Oracle
UNIX
Javascript




After Work

Highlife Adventures
The best club in Chicago
for Chicago Singles is Highlife Adventures!


Jersey Girl Shirts
Are you looking for a
Jersey Girl T-Shirt ?



Kyoto Sushi
in Chicago, on Lincoln Ave.
Moody's Pub
in Chicago, has great burgers
Skylark
in Chicago, on Halsted .. excellent Friday fish fry!


Oracle » PL-SQL » Context » Full Text Searc

Using the Context cartridge

     



Managing Context is an arduous task. The best approach is to use the
command line utility as much as possible. Below is a code sample which creates
a policy (a policy is a construct which informs context which column on
what table to scan during a search operation). The next example illustrates how
to perform a search, and stored the result keys in a table.


/* create a policy, on the emp_resume table */

ctx_svc.clear_all_errors;

dbms_output.put_line('Creating Policy ...');

ctx_ddl.create_policy(
POLICY_NAME => 'EMP_RES_POLICY',
COLSPEC => 'EMP_RES.RESUME',
SOURCE_POLICY => 'CTXSYS.DEFAULT_POLICY',
DESCRIPTION => 'EMP Policy',
TEXTKEY => 'EMP_ID',
DSTORE_PREF => 'CTXSYS.DEFAULT_DIRECT_DATASTORE',
FILTER_PREF => 'CTXSYS.HTML_FILTER',
LEXER_PREF => 'CTXSYS.DEFAULT_LEXER'
);

dbms_output.put_line('Indexing Policy ...');

ctx_ddl.create_index('EMP_POLICY');


/* Run a Context query, place the result key values in a table */

/* first, this table needs to be created */

CREATE TABLE EMP_CTX_RESULTS(
TEXTKEY VARCHAR2(64),
TEXTKEY2 VARCHAR2(64),
SCORE NUMBER,
CONID NUMBER );

/* this code can go in a stored proc */

POLICY1 := 'EMP_POLICY';
TABLE1 := 'EMP_CTX_RESULTS';
ID1 := 100 ;
QUERY1 := 'COBOL|FORTRAN';

CTX_QUERY.CONTAINS(POLICY1, QUERY1, TABLE1, 1, ID1);

/* the table will contain records with a CONID of 100 */
/* ... you can use ampersand or pipe as the conditional */










Oracle : Related Topics


Sybase Web Site
Sybase Mobile Web Site
Oracle Web Site





Site Index About this Guide to Sybase, Oracle, and UNIX Contact Us Advertise on this site




Copyright © 2008 Citisoft Inc All Rights Reserved.