Oracle8i interMedia Text Reference Release 2 (8.1.6) Part Number A77063-01 |
|
CTX_QUERY Package , 2 of 7
This procedure enables you to browse words in an interMedia Text index. You specify a seed word and BROWSE_WORDS returns the words around it in the index, and a rough count of the number of documents that contain each word.
This feature is useful for refining queries. You can identify the following:
ctx_query.browse_word( index_name in varchar2, seed in varchar2, restab in varchar2, browse_id in number default 0, numwords in number default 10, direction in varchar2 default BROWSE_AROUND );
ctx_query.browse_word( index_name in varchar2, seed in varchar2, resarr in out browse_tab, numwords in number default 10, direction in varchar2 default BROWSE_AROUND );
Specify the name of the index. You can specify schema.name
. Must be a local index.
Specify the seed word. This word is lexed before browse expansion. The word need not exist in the token table. seed must be a single word. Using multiple words as the seed will result in an error.
Specify the name of the result table. You can enter restab as schema.name
. You must have INSERT permissions on the table. This table must have the following schema.
Column | Datatype |
---|---|
browse_id |
number |
word |
varchar2(64) |
doc_count |
number |
Existing rows in restab are not deleted before BROWSE_WORDS is called.
Specify the name of the result array. resarr is of type ctx_query.browse_tab.
type browse_rec is record ( word varchar2(64), doc_count number ); type browse_tab is table of browse_rec index by binary_integer;
Specify a numeric identifier between 0 and 232. The rows produced for this browse have a value of in the browse_id column in restab. When you do not specify browse_id, it defaults to 0.
Specify the length of the produced list in number of words. Specify a number between 1 and 1000.
Specify the direction for the browse. You can specify one of:
Symbols CTX_QUERY.BROWSE_BEFORE, CTX_QUERY.BROWSE_AROUND, and CTX_QUERY.BROWSE_AFTER are defined for these literal values as well.
begin ctx_query.browse_words('myindex','dog','myres',numwords=>5,direction=>'AROUND'); end; select word, doc_count from myres order by word; WORD DOC_COUNT -------- ---------- CZAR 15 DARLING 5 DOC 73 DUNK 100 EAR 3
declare resarr ctx_query.browse_tab; begin ctx_query.browse_words('myindex','dog',resarr,5,CTX_QUERY.AROUND); for i in 1..resarr.count loop dbms_output.put_line(resarr(i).word || ':' || resarr(i).doc_count); end loop; end;
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|