Oracle Text (MOSC)

MOSC Banner

Wrong results searching for IP addresses

edited Jul 29, 2013 3:08AM in Oracle Text (MOSC) 7 commentsAnswered

We have a relatively simple query that looks for IP addresses via a Text Context index:
select doc
from addrtab
where CONTAINS(doc_idx,'192.168.01.%') > 0;

This query returns no rows, even though there are clearly token_text values in the DR#DOC_IDX$I table.  The index is built using the WORLD_LEXER, but I see the same results with BASIC_LEXER.  The database is 11.2.0.3.

If I change the query to this, simply removing the "." before the "%" in the query string:

select doc
from addrtab
where CONTAINS(doc_idx,'192.168.01%') > 0;

I get the expected rows back, and more, since it now matches on more of the 3rd octets than just "01"....011, 012, etc.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center