oracle全文索引之About_INDEX_THEMES操作
Oracle的全文索引除了支持文字匹配查询,还支持对文章涵义的查询。这是通过ABOUT操作实现的。
Oracle默认情况下支持英文和法文的文章涵义支持。其他语言可以添加通过用户自定义的语言库来实现相应的功能。
在
这之前需要先安装Companion CD 的Oracle Database 10g Products Installation
Type,其中包括了Oracle Text Supplied Knowledge
Bases,否则在建立含有about的索引时会出错。Companion CD可直接在官网下载,安装也非常简单。
下面看看英文环境下简单的ABOUT操作用法:
SQL> conn myuser/myuser
Connected.
SQL> CREATE TABLE T (ID NUMBER PRIMARY KEY, DOCS VARCHAR2(1000));
Table created.
SQL> INSERT INTO T VALUES (1, 'You can augment the knowledge base to define concepts and terms specific to your
industry or query application. When you do so, ABOUT queries are more precise for the added concepts.');
1 row created.
SQL> INSERT INTO T VALUES (2, 'ABOUT queries perform best when you create a theme component in your index. Theme
components are created by default for English and French.');
1 row created.
SQL> COMMIT;
Commit complete.
SQL> CREATE INDEX IND_T_DOCS ON T(DOCS) INDEXTYPE IS CTXSYS.CONTEXT;
Index created.
SQL> SELECT ID from T WHERE CONTAINS(DOCS, 'ABOUT(queries)') > 0;
ID
----------
1
2
SQL> SELECT ID from T WHERE CONTAINS(DOCS, 'queries') > 0;
ID
----------
1
2
默认的LEXER是BASIC_LEXER,因此,可以ABOUT操作已经可以起作用了,但是由于采用默认设置,ABOUT查询的精度不高。虽然可以查询到,但是这个单词本身就是在文章中出现的,如果使用文章中没有出现的单词,ABOUT还是查询不到。
SQL> SELECT ID from T WHERE CONTAINS(DOCS, 'ABOUT(definition)') > 0;
no rows selected
SQL> SELECT ID from T WHERE CONTAINS(DOCS, 'definition') > 0;
no rows selected
如果希望提高ABOUT操作的查询精度,可以设置BASIC_LEXER中的INDEX_THEMES属性的值为YES。
SQL> BEGIN
2 CTX_DDL.CREATE_PREFERENCE('TEST_ABOUT', 'BASIC_LEXER');
3 CTX_DDL.SET_ATTRIBUTE('TEST_ABOUT', 'INDEX_THEMES', 'YES');
4 CTX_DDL.
相关文档:
select ss.*,
sum(ss.aa) over (partition by ss.zsid order by ss.zsid) as fu,
sum(ss.bb) over (partition by ss.zsid order by ss.zsid) as zheng
from
(
select m.zsid,
sum(n.f0004_028n) ov ......
1.在A用户下授权“商户信息表”给B用户
grant all on TBL_INF_MCHNT_INF to B;
commit;
2.在B用户下建立同义词
create synonym TBL_INF_MCHNT_INF for A.TBL_INF_MCHNT_INF;
3. 查询数据库所有同义词select * from sys.synonyms ......
1、创建存储过程
create or replace procedure test(var_name_1 in type,var_name_2 out type) as
--声明变量(变量名 变量类型)
begin
--存储过程的执行体
end test;
打印出输入的时间信息
E.g:
create or replace procedure test(workDate in Date) is
begin
dbms_output.putline('The input date i ......
DATASTORE是FILE_DATASTORE的测试
[oracle@rhel140 ~]$ cat OUTPUT.TXT
ORACLE
oracle
[oracle@rhel140 LOG]$ cat EMPXT_000_2012_2680.LOG
SOURCE
ABC
SQL> conn myuser/myuser
Connected.
SQL> CREATE TABLE T (ID NUMBER, DOCS VARCHAR2(1000));
Table created.
SQL> INSERT INTO T VALUES (1, 'OUT ......
Oracle全文索引的WORDLIST属性用来设置模糊查询和同词根查询,另外WORDLIST属性还支持通配符查询。
Oracle的WORDLIST属性只有BASIC_WORDLIST一种,下面看一个BASIC_WORDLIST的例子:
1.Stemmer attribute是用来查询用词根的数据
SQL> create table stemmer_tbl(id number primary key,docs clob);
Table created.
S ......