|
|
|
Oracle TEXT - Как пользоваться ctx_doc.themes?
|
|||
|---|---|---|---|
|
#18+
Коллеги, подскажите пожалуйста. Впервые столкнулся с oracle text. Требуется классифицировать документ, хочу получить список тем документа, но он выходит пустым. Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 Делаю следующее: create table test_idx (id number not null, text varchar2(4000)); alter table test_idx add (constraint pk_test_idx_id primary key(id)); insert into test_idx values(1, 'About the FIRST_ROWS HintYou can also optimize for response time using the related FIRST_ROWS hint.'); insert into test_idx values(2, 'About the FIRST_ROWS HintYou can also optimize for response time using the related FIRST_ROWS hint.'); insert into test_idx values(3, 'About the FIRST_ROWS HintYou can also optimize for response time using the related FIRST_ROWS hint.'); commit; begin ctx_ddl.create_preference('my_lex', 'basic_lexer'); ctx_ddl.set_attribute ('my_lex', 'index_themes', 'yes'); ctx_ddl.set_attribute ('my_lex', 'index_text', 'yes'); end; create index test_mytext_idx on test_idx(text) indextype is CTXSYS.CONTEXT parameters ('lexer my_lex'); --На всякий случай перестроим индекс alter index test_mytext_idx rebuild online parameters('sync memory 30M'); --Поиск работает select score(2), text from test_idx where contains(text, '{'||'FIRST_ROWS'||'}', 2) > 0 order by score(2) desc; --Выводим темы - и тут пусто???????? declare the_themes ctx_doc.theme_tab; begin ctx_doc.themes(index_name => 'test_mytext_idx',textkey => '1',restab => the_themes, full_themes => true); for i in 1..the_themes.count loop dbms_output.put_line(the_themes(i).theme||':'||the_themes(i).weight); end loop; end; ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 28.11.2016, 18:29 |
|
||
|
|

start [/forum/topic.php?fid=52&gotonew=1&tid=1886928]: |
0ms |
get settings: |
4ms |
get forum list: |
20ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
166ms |
get topic data: |
9ms |
get first new msg: |
5ms |
get forum data: |
4ms |
get page messages: |
29ms |
get tp. blocked users: |
1ms |
| others: | 240ms |
| total: | 484ms |

| 0 / 0 |
