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: 7984
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: Wed Sep 17 13:21:14 CDT 2014

Total time taken to generate the page: 0.10350 seconds