Oracle Text Help
Hello Gurus,
I am new to Oracle Text so i need your valuable inputs in resolving an issue i am facing.
Here is the table definition and sample data:
create table test ( a varchar2(100));
insert into test values('Hello How are you');
insert into test values('Just to say you Hello');
insert into test values('I know you');
insert into test values('you know');
insert into test values('you may not know me');
insert into test values('do i know you');
SQL> SELECT * FROM test;
A
Hello How are you
Just to say you Hello
I know you
you know
you may not know me
do i know you
6 rows selected.
If user enters search criteria ('you know', for example); i need to return all the records having 'you' AND 'know' anywhere. Hence for search criteria 'you know', i should get following records:
I know you
you know
you may not know me
do i know you
Similarly, i need to return below records for criteria 'hello you':
Hello How are you
Just to say you Hello
Can Oracle Text help me here?
Thanks in advance for your help.
regards,
SQL> create table test ( a varchar2(100))
Table created.
SQL> insert into test values('Hello How are you')
1 row created.
SQL> insert into test values('Just to say you Hello')
1 row created.
SQL> insert into test values('I know you')
1 row created.
SQL> insert into test values('you know')
1 row created.
SQL> insert into test values('you may not know me')
1 row created.
SQL> insert into test values('do i know you')
1 row created.
SQL> create index test_idx on test (a) indextype is ctxsys.context
Index created.
SQL> var str varchar2(100)
SQL> exec :str := 'you know'
PL/SQL procedure successfully completed.
SQL> select * from test where contains(a,:str) > 0
A
I know you
you know
you may not know me
do i know you
4 rows selected.
SQL> exec :str := 'hello you'
PL/SQL procedure successfully completed.
SQL> select * from test where contains(a,:str) > 0
A
Hello How are you
Just to say you Hello
2 rows selected.
Similar Messages
-
Hi,
I am using Oracle Text 9.2 on Oracle databas version 9.2. I want to search for two words, which should be next to each other. For ex.
select col1, col2
from tab1
where contains (col2, 'personal computer') > 0;
I don't want those rows, which have personal in one place and computer in another place. But above query giving all these rows. Please let me know.
Thanks a lot for the help.I want to search for two words, which should be next to each otherhere we go:
SQL> create table t as select 'my personal computer' col1 from dual union all
select 'personal' col1 from dual union all
select 'computer' col1 from dual union all
select 'personal pc computer' col1 from dual
Table created.
SQL> create index t_idx on t (col1) indextype is ctxsys.context
Index created.
SQL> select * from t where contains(col1, '{personal computer}') > 0
COL1
my personal computer
1 row selected. -
Oracle Text Help with XML column values
Hello. In addition to being new to Oracle Text, I am inheriting an Oracle Text application and have a couple of questions.
First, A context-based index has been set-up on a CLOB column which contains an XML formatted document. The Auto Section Group parameter has been set to created zones for each tag of the XML document. I have found that when using a browser to display the content of the CLOB, some of the column values have trouble displaying in the browser, where I receive an XML processing error. I believe this is due to the fact that some of the XML document rows contain URLs that are not embedded in the CDATA tag. In any case, if the browser has trouble displaying the XML, will oracle text have trouble indexing the XML and creating the section group zones?
Second, I understand that the NOT operator takes a right operand term and left operand term. Can either of the terms be the results of the WITHIN operator, i.e. "dogs not (cats within animals)".
Thank you.I bet you just whipped that out, and I thank you with all my
heart, its amazing to me how many ways I tried to do what you did.
Thanks
I have a second question relating to the same problem and
that is in referencing the over state. Currently, I can write
'text' into the text field and see what I have coming in from xml
in its place during the 'up' state.
However, when the timeline hits the 'over' state, the
textfield will display nothing, or 'text' if I have that written
in. I suspect that I am not referencing the'over' state correctly.
Should I add one line of code sort of referencing the text
field and not just the button while in the over state? -
Will Oracle Text help our project ?
Hi All,
We have an existing Oracle Web forms application.
Now we need to manage around 6000 different kind of documents(word, excel
and pdf"). This needs to be accessed over internet and we need to have search functionality.
Can we use Oracle Text for this?
Thank You
Rajesh AlexAbsolutely. One of the many things you can do with OT is check documents via data stored in CLOBs/BLOBs, on a storage device, or via URL.
Ain't it great? I'm just getting into OT, but it's unreal. -
Hi,
The sql below runs fast in 10gR2 using domain index, but when I uncomment the two commented lines, it reverts back to full table scan and takes longer. Can anyone explain why?
select
pharmacy_name
FROM pharmacy_test
WHERE 1=1
and
(:v_search_pharmacy_name is not null and
contains (pharmacy_name, '%' || :v_search_pharmacy_name || '%') > 0
-- or
-- :v_search_pharmacy_name is null )
Thanks,
JGPHere's the plan for the original sql:
SELECT STATEMENT ALL_ROWSCost: 11,811 Bytes: 142,940 Cardinality: 4,084
* 1 TABLE ACCESS FULL TABLE REPORTUSER.PHARMACY_TEST Cost: 11,811 Bytes: 142,940 Cardinality: 4,084*
And here's the one with the null check:
SELECT STATEMENT ALL_ROWSCost: 14 Bytes: 1,435 Cardinality: 41
* 3 FILTER *
* 2 TABLE ACCESS BY INDEX ROWID TABLE REPORTUSER.PHARMACY_TEST Cost: 14 Bytes: 1,435 Cardinality: 41 *
* 1 DOMAIN INDEX INDEX (DOMAIN) REPORTUSER.PHARMACY_TEST_IX1 Cost: 4*
Thanks,
JGP
Edited by: user567088 on Oct 28, 2009 10:47 AM -
Hi Masters,
I am working on Oracle Text. I have executed the below step/commands. All are executed successfully. But I didn't seen any improvement in my task. But I have one doubt, will explain below.
create table ent_dnt as select * from entitlement_dnt;
BEGIN
CTX_DDL.CREATE_PREFERENCE ('oracletext_datastore', 'MULTI_COLUMN_DATASTORE');
CTX_DDL.SET_ATTRIBUTE
('oracletext_datastore', 'COLUMNS',
'ORDER_NUMBER, GENERIC_PRODUCT_NAME_EXT, ENTITLEMENT_REF_ID, DEVICE_ASSET_ID, DEVICE_UNIQUE_ID, SWSERVICETAG, PRODUCT_DESC');
END;
CREATE INDEX idx_oracle_text
ON Ent_dnt (search_cols)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS ('DATASTORE oracletext_datastore');
BEGIN
DBMS_STATS.GATHER_TABLE_STATS('EE', 'ent_DNT', cascade=>TRUE);
DBMS_STATS.GATHER_TABLE_STATS('EE', 'upd_DNT', cascade=>TRUE);
dbms_stats.gather_index_stats('EE', 'idx_oracle_text1');
dbms_stats.gather_index_stats('EE', 'idx_oracle_text');
END;
the above steps are created / executed successfully. But when execute my select query..I didn't seen anywhere oracle text index name in my explain plan.
Plan
SELECT STATEMENT ALL_ROWSCost: 28,393 Bytes: 49,675 Cardinality: 5
3 SORT AGGREGATE Bytes: 8 Cardinality: 1
2 TABLE ACCESS BY INDEX ROWID TABLE EE.EE_PROD_GRP_ENTITLEMENT Cost: 4 Bytes: 8 Cardinality: 1
1 INDEX RANGE SCAN INDEX EE.IDX_PGE_ENT_ID Cost: 3 Cardinality: 1
5 SORT AGGREGATE Bytes: 8 Cardinality: 1
4 TABLE ACCESS FULL TABLE EE.ENT_DNT Cost: 26,781 Bytes: 8 Cardinality: 1
20 VIEW EE. Cost: 28,393 Bytes: 49,675 Cardinality: 5
19 COUNT STOPKEY
18 VIEW EE. Cost: 28,393 Bytes: 49,610 Cardinality: 5
17 SORT GROUP BY STOPKEY Cost: 28,393 Bytes: 2,295 Cardinality: 5
16 HASH JOIN OUTER Cost: 28,392 Bytes: 2,295 Cardinality: 5
14 NESTED LOOPS OUTER Cost: 28,388 Bytes: 1,808 Cardinality: 4
11 NESTED LOOPS OUTER Cost: 28,384 Bytes: 1,600 Cardinality: 4
8 HASH JOIN Cost: 28,383 Bytes: 1,552 Cardinality: 4
6 TABLE ACCESS FULL TABLE EE.UPD_DNT Cost: 1,089 Bytes: 174 Cardinality: 6
7 TABLE ACCESS FULL TABLE EE.ENT_DNT Cost: 27,292 Bytes: 110,648,108 Cardinality: 308,212
10 TABLE ACCESS BY INDEX ROWID TABLE EE.PRODUCT_LICENSE_PART Cost: 1 Bytes: 12 Cardinality: 1
9 INDEX RANGE SCAN INDEX EE.IDX_PLP_PD_DATA_ID Cost: 0 Cardinality: 1
13 TABLE ACCESS BY INDEX ROWID TABLE EE.PD_KT_DETAILS Cost: 1 Bytes: 52 Cardinality: 1
12 INDEX RANGE SCAN INDEX EE.IDX_PKD_PART_NUM Cost: 0 Cardinality: 1
15 TABLE ACCESS FULL TABLE EE.LEGACY_CONFIG Cost: 3 Bytes: 35 Cardinality: 5
and cost is also so high. But when I ran the below query. I didn't see any $ tables.
TEST@orcl_11gR2> SELECT object_name, object_type
2 FROM user_objects
3 WHERE object_name LIKE '%oracle%'
4 /
Usually DR$ $I, $K,$N,$R,$X tables are not creaed. where is the problem? please help me. I have to complete this task.
Regards
ARHi Roger,
Thanks alot for your reply. This is my query. Yes I didn't used contain clause in my query. But i don't know how to use.
SELECT B.*,
CASE WHEN ISBOUND = 'Y' AND ALLOWRESEND = 'Y' THEN 'Y' ELSE 'N' END
AS Allowunbind,
CASE
WHEN ISBOUND = 'Y' AND IsThisAnUpgrade = 'N' AND Allowresend = 'N'
THEN
'Y'
ELSE
CASE
WHEN ISBOUND = 'N'
AND BINDING_TYPE = INITCAP ('TRUSTED')
AND ALLOWRESEND = 'N'
THEN
'Y'
ELSE
'N'
END
END
AS AllowBind,
FNC_GET_GROUPNAME_V3 (B.ENTITLEMENT_ID) GROUP_NAME,
FNC_GET_USERGROUPNAME_V3 (B.ENTITLEMENT_ID, '[email protected]')
USER_GROUP_NAME,
FNC_GET_ROLE_V3 (B.ENTITLEMENT_ID, '[email protected]') ROLE_NAME,
(SELECT MAX (PGE_IS_ASSIGNED)
FROM ENT_DNT
WHERE ENTITLEMENT_ID = B.ENTITLEMENT_ID)
AS IS_ASSIGNED
FROM (SELECT *
FROM (SELECT A.*, ROWNUM RNUM
FROM (SELECT *
FROM (SELECT *
FROM (SELECT DISTINCT
ENTDNT.ORDER_DATE,
ENTDNT.ORDER_NUMBER,
ENTDNT.ENTITLEMENT_ID,
ENTDNT.ENTITLEMENT_REF_ID,
ENTDNT.CUSTOMER_NUM,
ENTDNT.ENTITLEMENT_STATUS_ID,
ENTDNT.ENT_QTY,
ENTDNT.ENTITLEMENTNAME,
ENTDNT.ACT_KEY_LOB_ID,
ENTDNT.LIC_KEY_LOB_ID,
ENTDNT.LICENSE_KEY,
ENTDNT.ENT_TYPE_ID,
ENTDNT.PRODUCT_DATA_ID,
ENTDNT.PRODUCT_NAME,
ENTDNT.TYPE_DIMENSION_EXT,
ENTDNT.BINDING_TYPE,
DECODE (
ENTDNT.ENT_TYPE_ID,
1, ENTDNT.PRODUCT_DESC,
3, ENTDNT.GENERIC_PRODUCT_NAME_EXT)
AS PRODUCT_DESC,
DECODE (
ENTDNT.ENT_TYPE_ID,
3, PKD.PRIMARY_LICENSE_IDENTIFIER,
2, 'SOFTWARE_SERVICETAG',
1, 'ENTITLEMENTID',
NULL)
AS PRIMARYLICENSEIDENTIFIER,
CASE
WHEN DECODE (
ENTDNT.ENT_TYPE_ID,
3, DECODE (
PKD.KEY_SOURCE_TYPE,
'SOURCE_NO_KEY', 'N',
'Y'),
1, 'Y',
LC.IS_KEY_REQUIRED) =
'Y'
AND ENTDNT.ENTITLEMENT_STATUS_ID =
'0'
AND ( ENTDNT.LIC_KEY_LOB_ID
IS NOT NULL
OR ENTDNT.LICENSE_KEY
IS NOT NULL
OR ENTDNT.ACT_KEY_LOB_ID
IS NOT NULL)
THEN
'Y'
WHEN ENTDNT.ENTITLEMENT_STATUS_ID =
'0'
AND ( ENTDNT.LIC_KEY_LOB_ID
IS NOT NULL
OR ENTDNT.LICENSE_KEY
IS NOT NULL)
THEN
'Y'
ELSE
'N'
END
AS KEYREQUIRED,
ENTDNT.ISTHISANUPGRADE,
ENTDNT.DEVICE_ASSET_ID,
ENTDNT.SWSERVICETAG,
PKD.PHVALUE,
CASE
WHEN -- ENTDNT.BINDING_TYPE = 'Trusted'
ENTDNT.BINDING_TYPE =
INITCAP ('TRUSTED')
THEN
'N'
WHEN ENTDNT.BINDING_TYPE =
INITCAP (
'COMPONENT')
-- OR ENTDNT.BINDING_TYPE = 'DeviceID'
OR ENTDNT.BINDING_TYPE =
INITCAP (
'DEVICEID')
--OR ENTDNT.BINDING_TYPE = 'ServiceTag'
OR ENTDNT.BINDING_TYPE =
INITCAP (
'SERVICETAG')
THEN
'Y'
ELSE
'N'
END
AS ISBOUND,
CASE
WHEN ENTDNT.ENT_TYPE_ID =
3
AND PKD.ALLOW_RESEND =
'Y'
AND ENTDNT.ENTITLEMENT_STATUS_ID =
'0'
AND ( ENTDNT.LIC_KEY_LOB_ID
IS NOT NULL
OR ENTDNT.LICENSE_KEY
IS NOT NULL
OR ENTDNT.ACT_KEY_LOB_ID
IS NOT NULL)
THEN
'Y'
WHEN ENTDNT.ENTITLEMENT_STATUS_ID =
'0'
AND ( ENTDNT.LIC_KEY_LOB_ID
IS NOT NULL
OR ENTDNT.LICENSE_KEY
IS NOT NULL)
THEN
'Y'
ELSE
'N'
END
AS ALLOWRESEND,
ENTDNT.GENERIC_PRODUCT_NAME_EXT,
PLP.LICENSE_PART_NUMBER
AS SRVPARTNUMBER,
ENTDNT.DEVICE_UNIQUE_ID,
(SELECT MAX (IS_ASSIGNED)
FROM EE_PROD_GRP_ENTITLEMENT PGE
WHERE ENTITLEMENT_ID =
ENTDNT.ENTITLEMENT_ID)
AS IS_ASSIGNED,
ENTDNT.SINGLEFILEPERID
FROM ent_dnt ENTDNT,
PD_KT_DETAILS PKD,
PRODUCT_LICENSE_PART PLP,
Legacy_Config LC,
upd_dnt UPDNT
WHERE ENTDNT.PRODUCT_GROUP_ID =
UPDNT.PRODUCT_GROUP_ID
AND UPDNT.EMAIL_ADDRESS =
'[email protected]'
AND ENTDNT.ENT_TYPE_ID =
LC.ENTITLEMENT_TYPE_ID(+)
AND PLP.PRODUCT_DATA_ID(+) =
ENTDNT.PRODUCT_DATA_ID
AND PKD.PART_NUMBER(+) =
ENTDNT.LIC_PART_NUM
AND UPDNT.IS_DELETED = 'N'
AND ENTDNT.ENTITLEMENT_STATUS_ID IN
(0, 4)
AND ENTDNT.IS_DELETED = 'N')
WHERE (UPPER (GENERIC_PRODUCT_NAME_EXT) LIKE
'%IDRAC%')
OR (ORDER_NUMBER LIKE '%251608469%')
OR (ENTITLEMENT_REF_ID LIKE '%162523200%')
OR (DEVICE_ASSET_ID LIKE '%162523200%')
OR (DEVICE_UNIQUE_ID LIKE '%162523200%')
OR (SWSERVICETAG LIKE '%162523200%')
OR (UPPER (PRODUCT_DESC) LIKE
'%162523200%'))
WHERE (UPPER (GENERIC_PRODUCT_NAME_EXT) LIKE
'%575757%')
OR (ORDER_NUMBER LIKE '%251608469%')
OR (ENTITLEMENT_REF_ID LIKE '%162523200%')
OR (DEVICE_ASSET_ID LIKE '%162523200%')
OR (DEVICE_UNIQUE_ID LIKE '%162523200%')
OR (SWSERVICETAG LIKE '%162523200%')
OR (UPPER (PRODUCT_DESC) LIKE '%162523200%')) A
WHERE ROWNUM <= 100)
WHERE RNUM >= 1) B;
yes..you are 100% correct. I did mistake with like operator. now I executed the below query. displaying all oracle related tables and indexes. Thank you.
SELECT object_name, object_type
FROM user_objects
WHERE object_name LIKE '%ORACLE%'
but here I have a problem. how can i run the below select for my above query?
SELECT *
2 FROM Entitlement_dnt
3 WHERE CONTAINS (search_cols, REPLACE (:i_OpenSearchText, ',', ' AND ')) > 0
here what can I do the value for :I_opensearchText ? confused.
please help me..!!
Regards
AR -
Help needed with oracle text special character search
Hi all
Using oracle 11g sql developer 4.0
I am facing this challenge where Oracle text when it comes to searching text that contains special character.
This what I have done so far with help of http://www.orafaq.com/forum/t/162229/
CREATE TABLE "SOS"."COMPANY"
( "COMPANY_ID" NUMBER(10,0) NOT NULL ENABLE,
"COMPANY_NAME" VARCHAR2(50 BYTE),
"ADDRESS1" VARCHAR2(50 BYTE),
"ADDRESS2" VARCHAR2(10 BYTE),
"CITY" VARCHAR2(40 BYTE),
"STATE" VARCHAR2(20 BYTE),
"ZIP" NUMBER(5,0)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
Insert into COMPANY (COMPANY_ID,COMPANY_NAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP) values (1,'LSG SOLUTIONS LLC',null,null,null,null,null);
Insert into COMPANY (COMPANY_ID,COMPANY_NAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP) values (2,'LOVE''S TRAVEL',null,null,null,null,null);
Insert into COMPANY (COMPANY_ID,COMPANY_NAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP) values (3,'DEVON ENERGY',null,null,null,null,null);
Insert into COMPANY (COMPANY_ID,COMPANY_NAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP) values (4,'SONIC INC',null,null,null,null,null);
Insert into COMPANY (COMPANY_ID,COMPANY_NAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP) values (5,'MSCI',null,null,null,null,null);
Insert into COMPANY (COMPANY_ID,COMPANY_NAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP) values (6,'ERNEST AND YOUNG',null,null,null,null,null);
Insert into COMPANY (COMPANY_ID,COMPANY_NAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP) values (7,'JOHN DEER',null,null,null,null,null);
Insert into COMPANY (COMPANY_ID,COMPANY_NAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP) values (8,'Properties@Oklahoma, LLC',null,null,null,null,null);
Insert into COMPANY (COMPANY_ID,COMPANY_NAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP) values (9,'D.D.T L.L.C.',null,null,null,null,null);
BEGIN
CTX_DDL.CREATE_PREFERENCE ('your_lexer', 'BASIC_LEXER');
CTX_DDL.SET_ATTRIBUTE ('your_lexer', 'SKIPJOINS', '.,@-'''); -- to skip . , @ - ' symbols
END;
CREATE INDEX my_index2 ON COMPANY(COMPANY_NAME)
INDEXTYPE IS CTXSYS.CONTEXT PARALLEL
PARAMETERS ('LEXER your_lexer');
SELECT
company_name
FROM company
WHERE CATSEARCH(company.COMPANY_NAME, 'LLC','') > 0
ORDER BY company.COMPANY_ID;
output
company_name
1 LSG SOLUTIONS LLC
2 Properties@Oklahoma, LLC
only return 2 row but should return 3I just noticed that I forgot to use an empty stoplist, so I have added that to the revised example below. Otherwise, it uses a default stoplist that would not index common single-letter words like A and I.
1. Whtat is Just search on single character 'L'? It give me error.
Since it uses the NEAR operator, searching for just one letter causes incomplete syntax, asking it to search for L near a missing second value. So, I have added additional code to allow for just one letter.
2. How do I do auto refresh on this index on datastore?
If I add "sync (on commit)" it does not refresh the previously set token.
Sync(on commit) does synchronize so that the data is immediately searchable. You have to either optimize or rebuild or drop and recreate the index to condense the rows in the domain index table.
3.lastly explanation of
<seq>NEAR((' || letters_func (:search_string) || '),1,TRUE)</seq>
<seq>NEAR((' || letters_func (:search_string) || '),100,TRUE)</seq>
<seq>NEAR((' || letters_func (:search_string) || '),100,FALSE)</seq>
why 100 true and 100 false
100 is just a default value that I used for the second parameter of near, indicating how close the letters need to be to each other. True and False are values for the third parameter of near, indicating whether or not the letters must be in the same order or not. So, it returns the results in the order of first those that are very close to one another and in the same order, then those that may be further away but in the same order, then those that may be further away and in any order.
SCOTT@orcl12c> CREATE TABLE company_near
2 (company_id NUMBER(10,0) NOT NULL ENABLE,
3 company_name VARCHAR2(50 BYTE))
4 /
Table created.
SCOTT@orcl12c> SET DEFINE OFF
SCOTT@orcl12c> BEGIN
2 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (1,'LSG SOLUTIONS LLC');
3 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (2,'LOVE''S TRAVEL');
4 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (3,'DEVON ENERGY');
5 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (4,'SONIC INC');
6 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (5,'MSCI');
7 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (6,'ERNEST AND YOUNG');
8 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (7,'JOHN DEER');
9 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (8,'Properties@Oklahoma, LLC');
10 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (9,'D.D.T L.L.C.');
11 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (10,'LSG COMPANY, LLC');
12 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (11,'LSG STAFFING, LLC');
13 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (12,'L & S GROUP LLC');
14 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (13,'L S & G, INC.');
15 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (14,'L.S.G. PROPERTIES, L.L.C.');
16 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (15,'LSGS PROPERTIES, LLC');
17 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (16,'LSQ INVESTORS, L.L.C');
18 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (17,'LHP SHERMAN/GRAYSON, LLC');
19 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (18,'Walmart');
20 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (19,'Wal mart');
21 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (20,'LSG Property Investments, L.L.C.');
22 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (21,'1224 S GALVESTON AVE, LLC');
23 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (22,'1527 S GARY AVE, LLC');
24 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (23,'FIFTEENTH STREET GRILL');
25 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (24,'Massa Lobortis LLP');
26 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (25,'Risus A Inc.');
27 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (26,'Dollar $ store');
28 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (27,'L.O.V.E., INC. ');
29 Insert into COMPANY_NEAR (COMPANY_ID,COMPANY_NAME) values (28,'J-MART LLC ');
30 END;
31 /
PL/SQL procedure successfully completed.
SCOTT@orcl12c> CREATE OR REPLACE FUNCTION letters_func
2 (p_string IN VARCHAR2)
3 RETURN VARCHAR2
4 AS
5 v_string VARCHAR2(4000);
6 BEGIN
7 FOR i IN 1 .. LENGTH (p_string)
8 LOOP
9 IF REGEXP_LIKE (SUBSTR (p_string, i, 1), '[A-Z]', 'i')
10 THEN
11 v_string := v_string || SUBSTR (p_string, i, 1) || ',';
12 END IF;
13 END LOOP;
14 v_string := RTRIM (v_string, ',');
15 RETURN v_string;
16 END letters_func;
17 /
Function created.
SCOTT@orcl12c> BEGIN
2 CTX_DDL.CREATE_PREFERENCE ('letters_datastore', 'MULTI_COLUMN_DATASTORE');
3 CTX_DDL.SET_ATTRIBUTE
4 ('letters_datastore',
5 'COLUMNS',
6 'letters_func (company_name) company_name');
7 CTX_DDL.SET_ATTRIBUTE ('letters_datastore', 'DELIMITER', 'NEWLINE');
8 END;
9 /
PL/SQL procedure successfully completed.
SCOTT@orcl12c> CREATE INDEX letters_index ON company_near (company_name)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 PARAMETERS
4 ('DATASTORE letters_datastore
5 STOPLIST CTXSYS.EMPTY_STOPLIST
6 SYNC (ON COMMIT)')
7 /
Index created.
SCOTT@orcl12c> SELECT COUNT(*) FROM dr$letters_index$i
2 /
COUNT(*)
24
1 row selected.
SCOTT@orcl12c> VARIABLE search_string VARCHAR2(100)
SCOTT@orcl12c> EXEC :search_string := 'LSG'
PL/SQL procedure successfully completed.
SCOTT@orcl12c> SELECT SCORE(1), company_id, company_name
2 FROM company_near
3 WHERE CONTAINS
4 (company_name,
5 '<query>
6 <textquery>
7 <progression>
8 <seq>' || :search_string || '</seq>
9 <seq>NEAR((' || letters_func (:search_string) || '),1,TRUE)</seq>
10 <seq>NEAR((' || letters_func (:search_string) || '),100,TRUE)</seq>
11 <seq>NEAR((' || letters_func (:search_string) || '),100,FALSE)</seq>
12 </progression>
13 </textquery>
14 </query>',
15 1) > 0
16 ORDER BY SCORE(1) DESC
17 /
SCORE(1) COMPANY_ID COMPANY_NAME
56 1 LSG SOLUTIONS LLC
56 10 LSG COMPANY, LLC
56 11 LSG STAFFING, LLC
56 12 L & S GROUP LLC
56 13 L S & G, INC.
56 14 L.S.G. PROPERTIES, L.L.C.
56 20 LSG Property Investments, L.L.C.
56 15 LSGS PROPERTIES, LLC
31 17 LHP SHERMAN/GRAYSON, LLC
8 21 1224 S GALVESTON AVE, LLC
4 22 1527 S GARY AVE, LLC
4 23 FIFTEENTH STREET GRILL
12 rows selected.
SCOTT@orcl12c> EXEC :search_string := 'L'
PL/SQL procedure successfully completed.
SCOTT@orcl12c> /
SCORE(1) COMPANY_ID COMPANY_NAME
78 1 LSG SOLUTIONS LLC
77 8 Properties@Oklahoma, LLC
77 9 D.D.T L.L.C.
77 10 LSG COMPANY, LLC
77 11 LSG STAFFING, LLC
77 12 L & S GROUP LLC
77 28 J-MART LLC
77 2 LOVE'S TRAVEL
77 26 Dollar $ store
77 24 Massa Lobortis LLP
77 23 FIFTEENTH STREET GRILL
77 14 L.S.G. PROPERTIES, L.L.C.
77 15 LSGS PROPERTIES, LLC
77 16 LSQ INVESTORS, L.L.C
77 17 LHP SHERMAN/GRAYSON, LLC
77 20 LSG Property Investments, L.L.C.
77 21 1224 S GALVESTON AVE, LLC
77 22 1527 S GARY AVE, LLC
76 19 Wal mart
76 18 Walmart
76 27 L.O.V.E., INC.
76 13 L S & G, INC.
22 rows selected.
SCOTT@orcl12c> INSERT INTO company_near (company_id, company_name) VALUES (30, 'Laris Gordman llc.' )
2 /
1 row created.
SCOTT@orcl12c> COMMIT
2 /
Commit complete.
SCOTT@orcl12c> SELECT COUNT(*) FROM dr$letters_index$i
2 /
COUNT(*)
35
1 row selected.
SCOTT@orcl12c> EXEC :search_string := 'Laris Gordman llc.'
PL/SQL procedure successfully completed.
SCOTT@orcl12c> SELECT SCORE(1), company_id, company_name
2 FROM company_near
3 WHERE CONTAINS
4 (company_name,
5 '<query>
6 <textquery>
7 <progression>
8 <seq>NEAR((' || letters_func (:search_string) || '),1,TRUE)</seq>
9 <seq>NEAR((' || letters_func (:search_string) || '),100,TRUE)</seq>
10 <seq>NEAR((' || letters_func (:search_string) || '),100,FALSE)</seq>
11 </progression>
12 </textquery>
13 </query>',
14 1) > 0
15 ORDER BY SCORE(1) DESC
16 /
SCORE(1) COMPANY_ID COMPANY_NAME
100 30 Laris Gordman llc.
1 row selected.
SCOTT@orcl12c> EXEC CTX_DDL.OPTIMIZE_INDEX ('letters_index', 'FULL')
PL/SQL procedure successfully completed.
SCOTT@orcl12c> SELECT COUNT(*) FROM dr$letters_index$i
2 /
COUNT(*)
24
1 row selected. -
Online help index error w.r.t oracle text
Hi,
Error creating online help index.
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine ORA-20000: Oracle Text error: DRG-10700: preference does not exist: CTXSYS.DEFAULT_LEXER
when i click on help on htmldb and then when i click on find. i get this following error.
how do i fix this error.
Can someone help me please.
THanks,
Philip.Steps to resolve the domian index creation problem:
Step 1: Ensure the schema CTXSYS does not exist, if exists ignore the execution of “step 2”.
Step 2: Add the below mentioned statement above the existing statement(also mentioned below) in the catctx.sql file which is in the $ORACLE_HOME/ctx/admin" location.
Existing statement : Rem CTXDEF.sql - ctx default object creation
Statement to be added: grant execute on CTX_DDL to ctxsys ;
In SYS user login, execute the script to create CTXSYS schema and its related objects after confirming below parameters to this script
ctxsys - password of CTXSYS schema
SYSAUX - default tablespace
TEMP - default temp tablespace (Replace if your database default temporary tablespace is different)
SQL>@$ORACLE_HOME/ctx/admin/catctx.sql ctxsys SYSAUX TEMP NOLOCK
Step 3: In SYS user login execute the below script to recompile user objects
SQL>@$ORACLE_HOME/rdbms/admin/utlrp.sql
Step 4: In CTXSYS user login, execute the below script to create default preference for language ENGLISH
SQL>@$ORACLE_HOME/ctx/admin/defaults/drdefus.sql
Step 5 : In SYS User login ,execute the below script to give grant permission
SQL>grant ctxapp to DBusername identified by Password;
SQL>grant select on ctxsys.dr$preference to DBusername;
SQL>grant execute on CTX_DDL to DBusername;
Step 5: Login as DB user and execute the below drop index script if any already exists in same name
SQL>DROP INDEX LEI_CATALOG_SEARCH_SFIELD
Step 6: Login as DB user and create the below domain index
SQL>CREATE INDEX LEI_CATALOG_SEARCH_SFIELD ON LET_CATALOG_SEARCH (SEARCH_FIELD) INDEXTYPE IS CTXSYS.CONTEXT;
Regards,
Kamal.C
Edited by: 871818 on Jul 12, 2011 2:17 AM -
Help with creating oracle text index on 2 columns with partial html data
Hi,
I need to create an oracle text index on 2 columns.
TITLE - varchar(255) = contains plain text data
DESCRIPTION - CLOB = contains partial HTML data
This is what I created.
begin
ctx_ddl.create_preference ('Title_Description_Pref', 'MULTI_COLUMN_DATASTORE');
ctx_ddl.set_attribute('Title_Description_Pref', 'columns', 'TITLE, DESCRIPTION');
end;
begin
ctx_ddl.create_preference ('bid_lexer', 'BASIC_LEXER');
ctx_ddl.set_attribute('bid_lexer', 'index_stems', 'ENGLISH');
ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP');
end;
create index Bid_Title_Index on Bid(title) indextype is ctxsys.context parameters ('LEXER bid_lexer sync (every "sysdate+(1/24)")');
create index Bid_Title_Desc_Index on Bid(description) indextype is ctxsys.context parameters ('LEXER bid_lexer DATASTORE Title_Description_Pref sync (every "sysdate+(1/24)") filter ctxsys.null_filter section group htmgroup');
The problem is when I do a CONTAINS(description, '$(auction)')>0. I get results where the descriptions have the "auction" word (which is correct). But, the results also returned rows where the search word is inside an IMG tag. e.g. <img src="http://auction.de/120483" alt="Auction Logo"/>.
What I would like is to exclude rows where the search word is inside HTML tag attributes, results expected are rows having <a>Auction</a> or <p>For Auction</p> ... etc. Basically stripping the html tags and leave the text contents.
I'd appreciate some input.
Thanks,
AmielHi,
I need to create an oracle text index on 2 columns.
TITLE - varchar(255) = contains plain text data
DESCRIPTION - CLOB = contains partial HTML data
This is what I created.
begin
ctx_ddl.create_preference ('Title_Description_Pref', 'MULTI_COLUMN_DATASTORE');
ctx_ddl.set_attribute('Title_Description_Pref', 'columns', 'TITLE, DESCRIPTION');
end;
begin
ctx_ddl.create_preference ('bid_lexer', 'BASIC_LEXER');
ctx_ddl.set_attribute('bid_lexer', 'index_stems', 'ENGLISH');
ctx_ddl.create_section_group('htmgroup', 'HTML_SECTION_GROUP');
end;
create index Bid_Title_Index on Bid(title) indextype is ctxsys.context parameters ('LEXER bid_lexer sync (every "sysdate+(1/24)")');
create index Bid_Title_Desc_Index on Bid(description) indextype is ctxsys.context parameters ('LEXER bid_lexer DATASTORE Title_Description_Pref sync (every "sysdate+(1/24)") filter ctxsys.null_filter section group htmgroup');
The problem is when I do a CONTAINS(description, '$(auction)')>0. I get results where the descriptions have the "auction" word (which is correct). But, the results also returned rows where the search word is inside an IMG tag. e.g. <img src="http://auction.de/120483" alt="Auction Logo"/>.
What I would like is to exclude rows where the search word is inside HTML tag attributes, results expected are rows having <a>Auction</a> or <p>For Auction</p> ... etc. Basically stripping the html tags and leave the text contents.
I'd appreciate some input.
Thanks,
Amiel -
Hi,
from what I've read about it, the following has to be done.
e.g. CREATE index ticket_keywords_index ON ticket(keywords) indextype IS ctxsys.context;
CREATE index ticket_solution_index ON ticket(solution) indextype IS ctxsys.context;
SELECT * from ticket where ctxsys.contain(:P12Value_to_find);
But I wonder, how does it know on which index it has to look ?
Is there anyway to specify on what it should look ?
If yes, any idea how one goes on about that ?
If no, any idea how to avoid getting information from the two columns back, if one only needs one ?
Could it in a way be done, by adding a column in apex, that allows to put in a checkbox, at the top, to say include this column in the search, or not, or is this not the good way to do so ?
Or am i missing a point ?
Thanks for the help,
FlorisFloris,
Your query should be of the form:
SELECT *
FROM ticket
WHERE contains(indexed_col,:P12_VALUE_TO_FIND) > 0Where indexed_col is the name of the column on which you have built your Oracle Text index and :P12_VALUE_TO_FIND is the page item that contains the Search String.
Andy
http://atulley.wordpress.com/ -
Issues using Oracle Text conditions
Hi all,
I'm facing an issue executing a query on a VIEW using Oracle Text Indexes.
The DB version I'm using is "Enterprise 9.2.0.5".
TEST_VIEW is an sql-view that has a query on several tables where one of them has two Oracle Text indexes, one on field FIELD2 and another on FIELD3
executing this query I get 10 rows:
select *
from TEST_VIEW
where FIELD1 = 1001 -- regular condition
and (contains(FIELD2, 'Blitz') > 0 ) -- Oracle text condition
But if I add another condition on an existent Oracle Text Index, I'll get only 1 row:
select *
from TEST_VIEW
where FIELD1 = 1001
where (contains(FIELD2, 'Blitz') > 0 OR contains(FIELD3, 'Blitz') > 0)
As you can see the third condition was added using a logical OR, so I should get at least 10 rows ...
Can anyone help me ?
ThaNks in advance.
Eduardo.Eduardo,
Without a full test case, it is hard to see if there is something wrong or not. I did the following, and all worked fine on my 10g instance. I had to assume some things, but I at least think I have the basic gist of your inquiry in this example. Run it/change it to match your situation, and post back when you can.
Thanks,
Ron
CREATE TABLE Z_TEST1 (
FIELD1 VARCHAR2(30));
INSERT INTO Z_TEST1
VALUES ('QUICK');
INSERT INTO Z_TEST1
VALUES ('BROWN');
INSERT INTO Z_TEST1
VALUES ('FOX');
INSERT INTO Z_TEST1
VALUES ('QUICK');
INSERT INTO Z_TEST1
VALUES ('BROWN');
INSERT INTO Z_TEST1
VALUES ('FOX');
CREATE TABLE Z_TEST2 (
FIELD2 VARCHAR2(30));
INSERT INTO Z_TEST2
VALUES ('JUMPED');
INSERT INTO Z_TEST2
VALUES ('OVER');
INSERT INTO Z_TEST2
VALUES ('LAZY');
INSERT INTO Z_TEST2
VALUES ('DOG');
INSERT INTO Z_TEST2
VALUES ('QUICK');
INSERT INTO Z_TEST2
VALUES ('BROWN');
INSERT INTO Z_TEST2
VALUES ('FOX');
commit;
CREATE VIEW TEST_VIEW
AS
SELECT Z_TEST1.FIELD1 AS "FIELD1", Z_TEST2.FIELD2 AS "FIELD2"
FROM Z_TEST1, Z_TEST2;
CREATE INDEX Z_TEST1_IDX ON Z_TEST1(FIELD1)
INDEXTYPE IS CTXSYS.CONTEXT;
CREATE INDEX Z_TEST2_IDX ON Z_TEST2(FIELD2)
INDEXTYPE IS CTXSYS.CONTEXT;
select *
from TEST_VIEW
where CONTAINS(FIELD1, 'FOX') > 0;
14 rows
select *
from TEST_VIEW
where (CONTAINS(FIELD1, 'FOX') > 0 OR CONTAINS(FIELD2, 'FOX') > 0);
18 rows -
Index creation in Oracle Text ???
Hi,
I have never used oracle text before.
The background info is got corruption errors on database alert log, identified it is an oracle9.2.0.5 bug in aix 5.2, need to apply 9.2.0.6 patchset. Temporary solution provided by oracle support was to drop and recreate an index.
My approach was to identify the index name, associated column, reverse engineer the object ddl, drop the index and re-create the index. Should have been straight forward. The difference is the column is of BLOB datatype. My index script failed with ORA-02327. I get errors on alert log saying missing index.
Don't know how to re-create the index on BLOB column in a table.
Any help, much appreciated.
Thanks
MuraliHi,
For your recreation, check out CTX_REPORT.CREATE_INDEX_SCRIPT. It will generate all of the ddl that you need.
Thanks,
Ron -
Index rules in oracle text and query using matches
Dear All,
I would like to ask about rules and matches function in oracle text.
I followed an example in oracle text application developer's guide.
I have a rule table like this :
1 oracle
2 larry or ellison
3 oracle and text
4 market share
then, I create an index to that table. This is needed for calling matches function. Here is the syntax :
create index queryx on queries(query_string)
indextype is ctxsys.ctxrule;
then, I noticed that the result on DR$QUERYX$I table as follows :
LARRY 0 2 2 1 (BLOB)
MARKET 0 4 4 1 (BLOB) {MARKET} {SHARE}
ORACLE 0 1 1 1 (BLOB)
ORACLE 0 3 3 1 (BLOB) {TEXT}
ELLISON 0 2 2 1 (BLOB)
What I want to ask is why doesn't the words 'share' and 'text' appear in the DR$QUERYX$ table?
When we use matches function, it then search on the index result and consequently it wion't find the 'share' word. so when for example I do query like this :
select query_id from queries where matches(query_string,' It only share ten percent of all products sold')>0
it will give 0 result since the no word in ' It only share ten percent of all products sold' was in index table. But actually it could possibly be categorized as the 4 category which rules is 'market share'
I tried this in a larger set of data and get same result.
Here is my generated rules from my document collection :
1 {REQUIREMENTS} & {ELICITATION}
1 {REQUIREMENTS} ~ {ELICITATION} & {ACTOR}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} & {FURPS}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE} & {PROC}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE} ~ {PROC} & {SPEED}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE} ~ {PROC} ~ {SPEED} & {DOCUME}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE} ~ {PROC} ~ {SPEED} ~ {DOCUME} & {PLACED}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE} ~ {PROC} ~ {SPEED} ~ {DOCUME} ~ {PLACED} & {UNNECESSARY}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE} ~ {PROC} ~ {SPEED} ~ {DOCUME} ~ {PLACED} ~ {UNNECESSARY} & {MISUSE}
1 {INTERPRETATION} ~ {REQUIREMENTS}
2 {DESIGN} & {REPRESENTATION}
2 {DESIGN} ~ {REPRESENTATION} & {MAY} & {FOUNDATI} & {OCTOBER}
2 {DESIGN} ~ {REPRESENTATION} & {MAY} & {FOUNDATI} ~ {OCTOBER} & {PROCEDURAL}
2 {DESIGN} ~ {REPRESENTATION} & {MAY} & {FOUNDATI} ~ {OCTOBER} ~ {PROCEDURAL} & {STRICT}
2 {DESIGN} ~ {REPRESENTATION} & {MAY} & {FOUNDATI} ~ {OCTOBER} ~ {PROCEDURAL} ~ {STRICT} & {GRASP}
2 {DESIGN} ~ {REPRESENTATION} & {MAY} & {FOUNDATI} ~ {OCTOBER} ~ {PROCEDURAL} ~ {STRICT} ~ {GRASP} & {MANY} & {LAYER}
2 {DESIGN} ~ {REPRESENTATION} ~ {MAY}
3 {PM} & {TESTING} & {ATTRIBUTI}
And this is the index table result with ctxrule :
(only the token_text column shown)
PM
DESIGN
DESIGN
DESIGN
DESIGN
DESIGN
DESIGN
DESIGN
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
INTERPRETATION
so when I try to classify a document with the word ouline inside it, it should produce category 1 (based on the rules) but since there are no word 'outline' in index tabel, the matches will return 0 means that the document is not classifiedto any category. I don't understand why it happen. Anybody knows about this? I would really appreciate any help.
Thank you very much.Hm, I see. It do make sense. so nice to know.
But then in the second example I gift where I used larger table, as shown below :
Here is my generated rules from my document collection :
1 {REQUIREMENTS} & {ELICITATION}
1 {REQUIREMENTS} ~ {ELICITATION} & {ACTOR}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} & {FURPS}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE} & {PROC}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE} ~ {PROC} & {SPEED}
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE} ~ {PROC} ~ {SPEED} & {DOCUME}
1 {INTERPRETATION} ~ {REQUIREMENTS}
2 {DESIGN} & {REPRESENTATION}
2 {DESIGN} ~ {REPRESENTATION} & {MAY} & {FOUNDATI} & {OCTOBER}
2 {DESIGN} ~ {REPRESENTATION} & {MAY} & {FOUNDATI} ~ {OCTOBER} & {PROCEDURAL}
2 {DESIGN} ~ {REPRESENTATION} & {MAY} & {FOUNDATI} ~ {OCTOBER} ~ {PROCEDURAL} & {STRICT}
2 {DESIGN} ~ {REPRESENTATION} ~ {MAY}
3 {PM} & {TESTING} & {ATTRIBUTI}
As far as I know, the sign ' ~ ' means 'OR' and '&' means 'and' . So based on the 4th line in my table :
1 {REQUIREMENTS} ~ {ELICITATION} ~ {ACTOR} ~ {FURPS} ~ {OUTLINE}
it can be concluded that if any of the words stated there been queried, so the category '1' will appear as a result. But then before we can use 'matches' to query it, we need ti create index for the rules table . I did it and the result were :
(only the token_text column shown)
PM
DESIGN
DESIGN
DESIGN
DESIGN
DESIGN
DESIGN
DESIGN
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
REQUIREMENTS
INTERPRETATION
there were no words other than PM, DESIGN< REQUIREMENTS and INTERPRETATION. Why the words REQUIREMENTS, ELICITATION, ACTOR, FURPS, OUTLINE don't appear in the index result? -
Error In Installing Oracle Text
Hi All.
I tried to install Oracle TEXT from sys using catctx.sql file
SQL> @$ORACLE_HOME/ctx/admin/catctx.sql CTXSYS SYSAUX TEMP NOLOCK
SQL> connect CTXSYS/password
SQL> @$ORACLE_HOME/ctx/admin/defaults/drdefus.sql but I've got error like
select object_name, object_type, status from dba_objects where owner='CTXSYS' and status != 'VALID' order by object_name;and output is
OBJECT_NAME OBJECT_TYPE STATUS
DRVODM PACKAGE BODY INVALIDand output of following query is
select comp_name, status, substr(version,1,10) as version from dba_registry where comp_id = 'CONTEXT';
COMP_NAME STATUS VERSION
Oracle Text INVALID 10.1.0.4.0I've spooled output of installation.
Let me know what I'm missing in this installation?
Thanks for help.
Regards,
dave.Thanks Barbara for trying to help me.
It shows many errors that synonym already exists, may be because I tried to reinstall.
Along with that it has following things
drop type dr$session_state_t force
ERROR at line 1:
ORA-04043: object DR$SESSION_STATE_T does not exist and
drop type dr$itab_t force
ERROR at line 1:
ORA-04043: object DR$ITAB_T does not exist And below might be useful as it's in invalid state
Warning: Package Body created with compilation errors.
Errors for PACKAGE BODY DRVODM:
LINE/COL ERROR
7/4 PL/SQL: SQL Statement ignored
8/29 PL/SQL: ORA-00904: "CTXSYS"."DRVODM"."GET_FEATURES": invalid
identifier
25/4 PL/SQL: SQL Statement ignored
27/33 PL/SQL: ORA-00904: "CTXSYS"."DRVODM"."FEATURE_PREP_NC": invalid
identifier and lots of like this
drop public synonym contains
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist
drop public synonym score
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist
drop public synonym catsearch
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist
drop public synonym matches
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist I googled for solutuion and found you are kind of master on oracle text. I found your replies on http://www.orafaq.com/forum/t/166966/0/.
Thanks Barbara.
Regards.
Dave -
Error When Creating Oracle Text index using Lexer Keyword
Hi All,
I am getting following error when i creating oracle text index using lexer & stoplist keyword.
Pls Help me if any body know.
Thanks in Advance.
Error starting at line 1 in command:
CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
Post INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
Error at Command Line:1 Column:13
Error report:
SQL Error: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-11000: invalid keyword LEXER
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
29855. 00000 - "error occurred in the execution of ODCIINDEXCREATE routine"
*Cause: Failed to successfully execute the ODCIIndexCreate routine.
*Action: Check to see if the routine has been coded correctly.
Regards,
Jack R.Hi,
it works if you put an extra PARAMETERS clause at the end so the creation looks like:
CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') <== Added
Hope this helps
Herald ten Dam
Maybe you are looking for
-
aloha. i just purchased an ipad for my husband. it asked me to a set up an apple id for it. i already had one under my name, and so connected it to that. however, when i tried to download a software for him, it said 'apple id disabled'. how do i rea
-
HP 8650w Touchpad light doesn't work.
The light in the upper left hand corner of my touchpad of my new HP Elitebook 8560w doesn't seem to work and considering how large the touchpad is i would really like to turn it off when I'm typing. Is there a specific driver I should or need to (re
-
I have a PowerMac G4 Quicksilver 2002 running OSX 10.3.9, with Verizon DSL service. I suddenly have a very strange problem with my IP Address and some erratic behavior. When the internet connection works, my network settings are: Location: Verizon DS
-
External Hard Drive won't mount; "Owners Enabled: No"
I have a Maxtor external drive mounted with my airport. It was working fine. I disconnected it and then connected it directly to my MacBookPro. The laptop wouldn't recognize the drive. Disk Utility will recognize it, verified it, found two errors and
-
We recently migrated from SBS2003 to Windows 2012. Currently our 2012 Server is the Domain Controller, while the 2008 server running Exchange 2010 is just a computer part of the domain. I'd like to have redundancy for our Active Directory, so was go