473,394 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Indexing multiple fields with Oracle TEXT (Intermedia)

What's wrong with my sample ?

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production

connect ctxsys/ctxsys1

create table tmp_objects as select * from sys.dba_objects;
SQL> select count(*) from tmp_objects;

COUNT(*)
----------
28705

create or replace procedure idx_fields_as_one_clob(
p_id in rowid,
p_lob IN OUT clob
)
is
nb_fields number := 12;
begin
for c1 in (select * from tmp_objects where rowid = p_id)
loop
-- assemble into p_lob ANY data you want
-- indexed.
dbms_lob.writeappend( p_lob, length(c1.OWNER)
+length(c1.OBJECT_NAME)
+length(c1.SUBOBJECT_NAME)
+length(c1.OBJECT_ID)
+length(c1.DATA_OBJECT_ID)
+length(c1.OBJECT_TYPE)
+length(TO_CHAR(c1.CREATED,'YYYYMMDD'))
+length(TO_CHAR(c1.LAST_DDL_TIME,'YYYYMMDD'))
+length(c1.TIMESTAMP)
+length(c1.STATUS)
+length(c1.TEMPORARY)
+length(c1.GENERATED)
+length(c1.SECONDARY)
+ nb_fields,
c1.OWNER || ' ' ||
c1.OBJECT_NAME || ' ' ||
c1.SUBOBJECT_NAME || ' ' ||
c1.OBJECT_ID || ' ' ||
c1.DATA_OBJECT_ID || ' ' ||
c1.OBJECT_TYPE || ' ' ||
TO_CHAR(c1.CREATED,'YYYYMMDD') || ' ' ||
TO_CHAR(c1.LAST_DDL_TIME,'YYYYMMDD') || ' ' ||
c1.TIMESTAMP || ' ' ||
c1.STATUS || ' ' ||
c1.TEMPORARY || ' ' ||
c1.GENERATED || ' ' ||
c1.SECONDARY
);
end loop;
end;
/

alter table tmp_objects add dummy_col varchar2(1);

begin
-- ctx_ddl.drop_preference('tmp_user_datastore');
ctx_ddl.create_preference( 'tmp_user_datastore', 'user_datastore'
);
ctx_ddl.set_attribute( 'tmp_user_datastore', 'procedure',
'idx_fields_as_one_clob' );
end;
/

begin
-- ctx_ddl.drop_preference('my_lexer');
ctx_ddl.create_preference( 'my_lexer', 'BASIC_LEXER' );
ctx_ddl.set_attribute( 'my_lexer', 'base_letter', 'YES');
ctx_ddl.set_attribute( 'my_lexer', 'mixed_case', 'YES' );
end;
/

drop index foo2_idx;
create index foo2_idx on tmp_objects(dummy_col) indextype is
ctxsys.context parameters( 'datastore tmp_user_datastore lexer
my_lexer');

select * from tmp_objects where contains( dummy_col, 'JAVA', 1 ) > 0 ;
SQL> No rows selected

Thank's for your help !
Jul 19 '05 #1
1 3023
I don't see anything wrong with your procedure, but remember that when
you create the index, it does not instantaneously contain entries for
all existing data. The CTXSYS system indexes content on a separate
process, and sometimes it can take a while. This assumes that the row
with the 'JAVA' word was pre-existing. If you add it later, you need
to synch the index.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
2
by: Girish | last post by:
Hi all, We are doing an exercise of migrating an application (developed in Informix 4gl) from Informix to Oracle database. Before doing actual migration, we would like to know some of the key...
108
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would...
3
by: vonclausowitz | last post by:
Hi All, I was thinking of creating a table in my database to index all words in the database. That way I can quickly search for one or more words and the index table will return the words and...
0
by: cetram | last post by:
Hello! I'm trying to fix an appliaction created using ColdFusion MX and Oracle 9i. The application worked fine until our IT department reinstalled the oracle server. As far as I've been able to...
0
by: kc7zdm | last post by:
I'm using Oracle intermedia text indices in my database, and the Contains function from a VB.Net program using the system.data.oracleclient provider. When a query includes a number as a search term,...
0
by: Frank | last post by:
Robert Vabo wrote: Versions? You'll needs EE to start with... -- Regards, Frank van Bortel
1
by: Server Applications | last post by:
Hello I am trying to build a system where I can full-text index documents with UTF8 or UTF16 data using Oracle Text. I am doing the filtering in a third-party component outside the database, so...
1
by: hvellani | last post by:
Okay here is my problem... I have multiple csv files with data in each file. They are connected via foreign keys (with each table having its on primary key). I want to load these tables into an...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.