Home » Server Options » Text & interMedia » Oracle Text added column name to tokens (Oracle Database 10g Enterprise Edition Release 10.2.0.1.0)
Oracle Text added column name to tokens [message #346662] Tue, 09 September 2008 05:03 Go to previous message
smcdonald
Messages: 2
Registered: September 2008
Junior Member
Hi,

i have a problem with Oracle Text on our productive system.
For reproduce the problem I created a small table with three columns and checked the token_text values. Somehow Oracle Text also adds the column name to the indexed tokens. If a user now searchs for a text that doesn't exists but in the column name he finds all stored data.

Create Table and insert data
SQL> create table number_test (
  2      value_1 varchar(255),
  3      value_2 varchar(255),
  4      value_45 varchar(1)
  5  );

Table created.

SQL> insert into number_test (value_1, value_2) values ('some text', 'another text');

1 row created.

SQL> commit work;

Commit complete.


Create the preferences and index
SQL> begin
  2    ctx_ddl.create_preference('TEST_STORE', 'MULTI_COLUMN_DATASTORE');
  3    ctx_ddl.set_attribute('TEST_STORE', 'columns', 'value_1, value_2, value_45');
  4  end;
  5  /

PL/SQL procedure successfully completed.

SQL>
SQL> CREATE INDEX idx_number_test ON number_test (value_1)
  2         INDEXTYPE IS CTXSYS.CONTEXT
  3         PARAMETERS('DATASTORE TEST_STORE');

Index created.


Select something
SQL> COLUMN value_1 FORMAT A20 word_wrapped
SQL> COLUMN value_2 FORMAT A20 word_wrapped
SQL> select value_1, value_2 from number_test where contains(value_1, '1%', 0) > 0;

VALUE_1              VALUE_2
-------------------- --------------------
some text            another text


As you can see I got a search result for the query '1%' but no data contains '1%'. Only the token created by the column name:

SQL> COLUMN token_text FORMAT A20 word_wrapped
SQL> select token_text from DR$IDX_NUMBER_TEST$I;

TOKEN_TEXT
--------------------
1
2
45
VALUE
VALÜ
another
some
text

8 rows selected.


I hope someone can explain me what I am doing wrong or is it normal that oracle also indexes the colum names?

 
Read Message
Read Message
Read Message
Previous Topic: How to pass the value to a contains query using a parameter
Next Topic: index error
Goto Forum:
  


Current Time: Fri Apr 19 22:45:40 CDT 2024