Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem querying text with ctxsys.context index

Status
Not open for further replies.

rtmorgan

IS-IT--Management
Oct 30, 2000
1
US
Personal Oracle 8i Release 8.1.6.0.0 NT
SQL*Plus: Release 8.1.7.0.0

I am having problems querying a document stored BLOB
for a particular text string.

Table that holds documents

DOCTEST
Name Null? Type
--------------- -------- ----
DOC_ID NOT NULL NUMBER(38)
DESCR VARCHAR2(20)
TEXT BLOB

Index was created using:

create index DOCINDEX on doctest(text)
indextype is ctxsys.context

I can use a PL/SQL procedure to query the doctest
by 'doc_id' and return the full document as html, so I know
the document stored in 'TEXT' in the 'DOCTEST' table is ok.

The problem comes when I try to do a simple text query such
as:

select doc_id, score(1) from doctest
where contains (text, 'pencil', 1) > 0

It returns 'No rows selected'


I have checked and rechecked and one of the documents
stored in TEXT definitely contains the word 'pencil'.

Is the query expecting the TEXT column to contain text
stored as VARCHAR2 or similiar,not a BLOB? (still trying to get a handle on the LOBs)

In the PL/SQL procedure I mentioned above, i use
DBMS_LOB.READ and util_raw.cast_to_varchar2 to prep
the BLOB for display within HTML.

Should I use a similiar approach to prep the document
within the BLOB for text querying?

Any help would be greatly appreciated

rtmorgan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top