oracle-text

CONTAINS doesn't work with Oracle Text

倾然丶 夕夏残阳落幕 提交于 2020-01-15 05:24:28
问题 I am having an issue executing this query. SELECT * FROM gob_attachment WHERE CONTAINS (gob_a_document, 'java') > 0 It's giving me ORA-29902: error in executing ODCIIndexStart() routine ORA-20000: Oracle Text error: ORA-00942: table or view does not exist 29902. 00000 - "error in executing ODCIIndexStart() routine" *Cause: The execution of ODCIIndexStart routine caused an error. *Action: Examine the error messages produced by the indextype code and take appropriate action. After some googling

Oracle Text Contains and technical content

无人久伴 提交于 2019-12-24 10:08:15
问题 I'am searching for the technical word "AN-XYZ99". So I use SELECT * FROM foo WHERE CONTAINS(bar, 'AN{-}XYZ99') > 0 but I get also results like "FO-XYZ99" or "BAR-XYZ99". What can I do to ensure the expected result? I used BEGIN CTX_DDL.CREATE_PREFERENCE('FOO','BASIC_LEXER'); CTX_DDL.SET_ATTRIBUTE('FOO', 'ALTERNATE_SPELLING', 'GERMAN'); CTX_DDL.SET_ATTRIBUTE('FOO', 'COMPOSITE', 'GERMAN'); CTX_DDL.SET_ATTRIBUTE('FOO', 'MIXED_CASE', 'NO'); END; Sample data from column "bar" (VARCHAR2(4000)):

How to sync and optimize an Oracle Text index?

谁说胖子不能爱 提交于 2019-12-20 10:45:00
问题 We want to use a ctxsys.context index type for full text search. But I was quite surprised, that an index of this type is not automatically updated. We have 3 million documents with about 10k updates/inserts/deletes per day. What are your recommendations for syncing and optimizing an Oracle Text index? 回答1: I think 'SYNC EVERY' option, as described in previous answer only available in Oracle 10g or newer. If you're using older version of Oracle you would have to run sync operation

Oracle text search on multiple tables and joins

瘦欲@ 提交于 2019-12-18 18:04:45
问题 I have the following SQL statement. select emp_no,dob,dept_no from v_depts where catsearch (emp_no,'abc',NULL) > 0 or catsearch (dept_no,'abc',NULL) > 0 where v_depts is a view. Now I would like to add one or more tables as join so that I can do text search on columns e.g. employee_details contains employee information and I can join with emp_no I have created index on employee_details table for emp_name column, however I am not able to join with v_depts to search because I modify my sql

Expecting exact results when using contains clause in Oracle

风格不统一 提交于 2019-12-13 23:45:01
问题 I have a below contains clause query to get the best match queries. I have below two values in the table: 1. TRUSTS ACT 1973 and 2. TRUST ACCOUNTS ACT 1973. When I am searching using the below query with the string "TRUST ACT 1973" , for this search the actual result comes as TRUST ACCOUNTS ACT 1973 . But I am expecting the exact result as *TRUSTS ACT 1973* . Query: SELECT /*+first_rows(11) index(a fuzzy_leg_nm_idx)*/ a.unique_legislation_id, a.legislation_name, a.jurisdiction, score(1) sc

Query with wildcard and dot not matching data with Oracle Text index

纵然是瞬间 提交于 2019-12-13 02:37:52
问题 When using the wildcard character in combination with a dot in a text search, my query does not find the matching row. For example: CREATE TABLE MY_TABLE( ITEM_NUMBER VARCHAR2(50 BYTE) NOT NULL); INSERT INTO MY_TABLE (ITEM_NUMBER) VALUES ('1234.1234'); create index TIX_ITEMNO on MY_TABLE(ITEM_NUMBER) indextype is ctxsys.context; I want to find the row in MY_TABLE where ITEM_NUMBER column is '1234.1234' This does find the row: SELECT * FROM MY_TABLE WHERE CONTAINS(ITEM_NUMBER, '%1234') > 0

Oracle Text. Try to update column with context index

放肆的年华 提交于 2019-12-08 15:16:29
I'm trying to update a column with a context index. CREATE TABLE new_table(first_column NUMBER, text CLOB); INSERT INTO new_table VALUES(1,'Oracle'); INSERT INTO new_table VALUES(2,'Text'); COMMIT; CREATE INDEX idx_new_table_text ON new_table(text) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('SYNC ( ON COMMIT)'); With "PARAMETERS ('SYNC ( ON COMMIT)')" parameter I was able to add data to the table. But I still can't update the data in this column or delete rows from this table. UPDATE new_table SET text = 'new text' WHERE first_column = 3; COMMIT; Аnd after committing, I see errors: "Commit failed

Oracle Text. Try to update column with context index

对着背影说爱祢 提交于 2019-12-08 05:44:18
问题 I'm trying to update a column with a context index. CREATE TABLE new_table(first_column NUMBER, text CLOB); INSERT INTO new_table VALUES(1,'Oracle'); INSERT INTO new_table VALUES(2,'Text'); COMMIT; CREATE INDEX idx_new_table_text ON new_table(text) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('SYNC ( ON COMMIT)'); With "PARAMETERS ('SYNC ( ON COMMIT)')" parameter I was able to add data to the table. But I still can't update the data in this column or delete rows from this table. UPDATE new_table

Oracle Text: How to sanitize user input

天大地大妈咪最大 提交于 2019-12-06 09:25:13
问题 If anyone has experience using Oracle text ( CTXSYS.CONTEXT ), I'm wondering how to handle user input when the user wants to search for names that may contain an apostrophe. Escaping the ' seems to work in some cases, but not for 's at the end of the word - s is in the list of stop words, and so seems to get removed. We currently change simple query text (i.e. anything that's just letters) to %text% , for example: contains(field, :text) > 0 A search for O'Neil works, but Joe's doesn't. Has

Oracle Text: How to sanitize user input

痴心易碎 提交于 2019-12-04 11:47:46
If anyone has experience using Oracle text ( CTXSYS.CONTEXT ), I'm wondering how to handle user input when the user wants to search for names that may contain an apostrophe. Escaping the ' seems to work in some cases, but not for 's at the end of the word - s is in the list of stop words, and so seems to get removed. We currently change simple query text (i.e. anything that's just letters) to %text% , for example: contains(field, :text) > 0 A search for O'Neil works, but Joe's doesn't. Has anyone using Oracle Text dealt with this issue? Escape all special characters with backslashes. Curly