Solved

Oracle Text Contains Problem

Posted on 2009-06-30
3
580 Views
Last Modified: 2013-12-19
Hi Everyone,
I'm using the Oracle Text contains function, but it sometimes doesn't work properly.  It returns 0 (text not found) when the text is actually there.

For example:

select e.* , contains(e.emp_name, '%Jones%') as cont_val
from emp_table e
where e.emp_name = 'Jones'

Returns a row with cont_val = 0 (which means text not found).  Results for %Jones% in the contains function in the where clause return no rows.  This is a sporadic problem that only occurs for some rows in our table.  We're using Oracle 10.2.0.1.0.
Any ideas what's going on?
Thanks

0
Comment
Question by:leclaude
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24828838
How are you updating your text indexes? They are not immediately synched and must be maintained, unlike regular indexes.

http://download.oracle.com/docs/cd/B15595_01/content.101/b14493/text.htm#sthref776

See the docs on ctx_ddl.sync_index() for manually synching, try a manual sync and see if it shows.

0
 
LVL 1

Author Comment

by:leclaude
ID: 24903920
Why would an index need to be synched to return a row? At worst the query should be slow, but not miss results.
0
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 500 total points
ID: 24906622
That is how text indexes work. Text indexes are not standard Oracle b-tree indexes. The update does not happen immediately upon insert or update of the rows. Instead the change is scheduled, and will be applied when the next sync is run. In 10g and 11g I believe there is a setting that forces immediate update but it is poor for performance.

Please read this for an explanation:

http://www.oracle.com/technology/products/text/htdocs/Index_Maintenance.html
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to recover a database from a user managed backup
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question