Page 1 of 1

Oracle indexing (Resolved)

Posted: 2006/06/27 18:09:34
by foxb
UPDATE: Resolved :)


I'm new to oracle...

I've installed Oracle XE on CentOS 4.3 without problems.

Now I'm testing some features, and I need help(advise) from more expierenced oracle users.

I' ve read that oracle text is included in XE.

I tested it on data located into database - OK, but when I try to index word documents located on file system it does not work (no results returned)
This is how I did it:
This example creates a file datastore preference called COMMON_DIR that has a path of /mydocs:

ctx_ddl.set_attribute('COMMON_DIR','PATH','/mydocs test');<---------------------------------- here was the problem I had space in path

When you populate the table mytable, you need only insert filenames. The path attribute tells the system where to look during the indexing operation.

create table mytable(id number primary key, file_name varchar2(2000));
insert into mytable values(111555,'first.doc');
insert into mytable values(111556,'second.doc');

Create the index as follows:

create index myindex on mytable(docs)
indextype is ctxsys.context
parameters ('datastore COMMON_DIR');

Then I search with:

SELECT SCORE(1) file_name FROM mytable WHERE CONTAINS(file_name, 'about(oracle)', 1) > 0;

:-o :-o :-o :-(