Home » Server Options » Text & interMedia » Text Index returns column name as well (Oracle 11g)
Text Index returns column name as well [message #614552] Fri, 23 May 2014 04:21 Go to next message
sherlocksher
Messages: 14
Registered: June 2013
Junior Member
Hi,

When I create a a context index for a multi column data store and use a portion of the column name itself as the text to be searched for, I get all the records in the table. Is there a way to prevent this ?

Please see steps below.


Script is as follows.

create table mult_col ( mult_col1_table clob, mult_col2_table clob);


declare
begin
ctx_ddl.create_preference ('multcollexer', 'BASIC_LEXER');
ctx_ddl.set_attribute ('multcollexer', 'skipjoins', ';:.,()<>*"''#-');
ctx_ddl.create_preference ('mult_colDS', 'MULTI_COLUMN_DATASTORE');
ctx_ddl.set_attribute ('mult_colDS', 'COLUMNS', 'mult_col1_table, mult_col2_table');

end;

INSERT INTO MULT_COL (mult_col1_table,mult_col2_table)
values ( 'ENGINE COMPONENT ASSEMBLY', 'AIRPLANE HANGAR LANDING'
);

create index MULT_COL_idx on MULT_COL (mult_col1_table) indextype is ctxsys.context parameters ('lexer multcollexer datastore mult_colDS') ;


select count(1) from MULT_COL where contains (mult_col1_table,'ENGINE') > 0 -- return a count of 1

select count(1) from MULT_COL where contains (mult_col1_table,'COL1') > 0 -- return a count of 1

Why is the above query that searches for COL1 returning a count of 1 and is there a way to prevent it ?
Re: Text Index returns column name as well [message #614601 is a reply to message #614552] Fri, 23 May 2014 11:20 Go to previous message
Barbara Boehmer
Messages: 9100
Registered: November 2002
Location: California, USA
Senior Member
To prevent indexing of column names:

begin
  ctx_ddl.set_attribute ('mult_colDS', 'delimiter', 'newline');
end;
/

Previous Topic: Needs to create stop list for non English
Next Topic: Performance issues and options to reduce load with Oracle text implementation
Goto Forum:
  


Current Time: Sat Nov 23 07:00:34 CST 2024