Home » Server Options » Text & interMedia » Near operator with Ctxcat index (split from CTXCAT / CONTEXT index by bb)
Near operator with Ctxcat index (split from CTXCAT / CONTEXT index by bb) [message #351314] Tue, 30 September 2008 05:05 Go to next message
akhanna
Messages: 1
Registered: August 2008
Location: Gurgaon
Junior Member
hey...

I am a beginner in oracle text.
Can some one plese tell me that can we use Near operator with Ctxcat index ??

I just read thru below link
http://www.oracle.com/technology/products/text/x/Tech_Overviews/imt_817.html

dt we can not use but it is for 8i ....Are there any additions done in 9i or 10G for same?

Its Urgent Please Help.

Thanks,
Alka
Re: CTXCAT / CONTEXT index [message #351325 is a reply to message #351314] Tue, 30 September 2008 05:28 Go to previous messageGo to next message
Michel Cadot
Messages: 58847
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
OracleŽ Text Reference

Regards
Michel
Re: Near operator with Ctxcat index (split from CTXCAT / CONTEXT index by bb) [message #351432 is a reply to message #351314] Tue, 30 September 2008 16:50 Go to previous message
Barbara Boehmer
Messages: 7966
Registered: November 2002
Location: California, USA
Senior Member
If you are using a ctxcat index, then you must use the catsearch operator to search it. The catsearch operator is very limited by itself and does not support NEAR. However, if you use a query template so that you can use the context grammar, then you can use NEAR. I have demonstrated this below. It might be beneficial if you only occasionally use NEAR. However, if you are going to use queries with NEAR or other things that catsearch does not support frequently, then you might as well just use a context idex.

SCOTT@orcl_11g> CREATE TABLE test_tab (test_col VARCHAR2(30))
  2  /

Table created.

SCOTT@orcl_11g> INSERT INTO test_tab (test_col) VALUES ('cat mouse dog')
  2  /

1 row created.

SCOTT@orcl_11g> CREATE INDEX test_idx ON test_tab (test_col)
  2  INDEXTYPE IS CTXSYS.CTXCAT
  3  /

Index created.

SCOTT@orcl_11g> SELECT * FROM test_tab
  2  WHERE  CATSEARCH (test_col, 'cat NEAR dog', NULL) > 0
  3  /

no rows selected

SCOTT@orcl_11g> SELECT * FROM test_tab
  2  WHERE  CATSEARCH
  3  	      (test_col,
  4  	       '<query>
  5  		  <textquery grammer="context">
  6  		    cat NEAR dog
  7  		  </textquery>
  8  		</query>', NULL) > 0
  9  /

TEST_COL
------------------------------
cat mouse dog

SCOTT@orcl_11g>

Previous Topic: Problem with Fuzzy Query
Next Topic: CONTEXT index and Tune with context (2 cross-posts merged by bb)
Goto Forum:
  


Current Time: Wed Aug 20 19:56:43 CDT 2014

Total time taken to generate the page: 0.05312 seconds