Home » Server Options » Text & interMedia » CATSEARCH with Fuzzy Matching...?
CATSEARCH with Fuzzy Matching...? [message #388131] Mon, 23 February 2009 06:41 Go to next message
ledo
Messages: 7
Registered: February 2009
Junior Member
Is there fuzzy matching for CTXCAT INDEXTYPE?!

I tried to write 'CA' for fuzzy searching:

SELECT * FROM places_1

WHERE CATSEARCH (ENG_NAME, '?CA', null) > 0

and I have no returned records...?

If yes, is there a different syntax for running fuzzy for Catsearch instead of this one which supported with Contains?
"fuzzy (term, score, numresults, weight)" OR '?'

Thanks in advance,
Re: CATSEARCH with Fuzzy Matching...? [message #388188 is a reply to message #388131] Mon, 23 February 2009 14:15 Go to previous message
Barbara Boehmer
Messages: 9101
Registered: November 2002
Location: California, USA
Senior Member
You can use a query template to use the context grammar in a catsearch of a ctxcat index, so that you can use fuzzy, as shown below.

SCOTT@orcl_11g> CREATE TABLE places_1
  2    (eng_name  VARCHAR2 (30))
  3  /

Table created.

SCOTT@orcl_11g> INSERT ALL
  2  INTO places_1 VALUES ('sumwhere')
  3  INTO places_1 VALUES ('nowhere')
  4  SELECT * FROM DUAL
  5  /

2 rows created.

SCOTT@orcl_11g> CREATE INDEX places_1_eng_name_idx
  2  ON places_1 (eng_name)
  3  INDEXTYPE IS CTXSYS.CTXCAT
  4  /

Index created.

SCOTT@orcl_11g> SELECT * FROM places_1
  2  WHERE  CATSEARCH (ENG_NAME, '?somewhere', null) > 0
  3  /

no rows selected

SCOTT@orcl_11g> SELECT * FROM places_1
  2  WHERE  CATSEARCH
  3  	     (ENG_NAME,
  4  	      '<query>
  5  		 <textquery grammar="CONTEXT">?somewhere</textquery>
  6  	       </query>',
  7  	      null) > 0
  8  /

ENG_NAME
------------------------------
sumwhere

SCOTT@orcl_11g> 

Previous Topic: Context IndexType & can I use contains in searching for Arabic Values?
Next Topic: CONTEXT SCORE is equal...
Goto Forum:
  


Current Time: Sun Dec 22 22:19:03 CST 2024