Home » Server Options » Text & interMedia » Default search behavior not understood
Default search behavior not understood [message #138356] Wed, 21 September 2005 09:11 Go to next message
pmj1
Messages: 11
Registered: June 2005
Location: Ann Arobr, MI
Junior Member
We are approaching going production with our Oracle Text application and are doing some beta testing. One serious issue that has come up is that the searches are not working the way we thought they would.

We apparently do not under stand the default semantics of the CONTAINS operator. Our understanding is that all four of the following should result in the same set of hits. It looks as if the actual default (no boolean operator) is a phrase search.

contains(resourceId_t, '{child} {care}', 1) > 0 4,237
contains(resourceId_t, '{child} AND {care}', 1) > 0 4,703
contains(resourceId_t, '{care} {child} ', 1) > 0 903
contains(resourceId_t, '{care} and {child} ', 1) > 0 4,703
Re: Default search behavior not understood [message #138395 is a reply to message #138356] Wed, 21 September 2005 12:51 Go to previous message
Barbara Boehmer
Messages: 9100
Registered: November 2002
Location: California, USA
Senior Member
-- table, data, and index for testing:
scott@ORA92> CREATE TABLE test_tab
  2    (resourceId_t VARCHAR2(60))
  3  /

Table created.

scott@ORA92> INSERT ALL
  2  INTO test_tab VALUES ('It is a good child care facility.')
  3  INTO test_tab VALUES ('Every child needs care.')
  4  INTO test_tab VALUES ('Is a care child like a care bear?')
  5  INTO test_tab VALUES ('We provide good care for your child.')
  6  SELECT * FROM DUAL
  7  /

4 rows created.

scott@ORA92> CREATE INDEX test_tab_idx
  2  ON test_tab (resourceId_t)
  3  INDEXTYPE IS CTXSYS.CONTEXT
  4  /

Index created.


-- the word "child" followed by the word "care"
-- in that order, with no other words inbetween:
scott@ORA92> SELECT * FROM test_tab
  2  WHERE contains(resourceId_t, '{child} {care}', 1) > 0
  3  /

RESOURCEID_T
------------------------------------------------------------
It is a good child care facility.


-- the word "care" followed by the word "child"
-- in that order, with no other words inbetween:
scott@ORA92> SELECT * FROM test_tab
  2  WHERE contains(resourceId_t, '{care} {child} ', 1) > 0
  3  /

RESOURCEID_T
------------------------------------------------------------
Is a care child like a care bear?


-- the word "child" and the word "care"
-- in any order, with any words inbetween:
scott@ORA92> SELECT * FROM test_tab
  2  WHERE contains(resourceId_t, '{child} AND {care}', 1) > 0
  3  /

RESOURCEID_T
------------------------------------------------------------
We provide good care for your child.
Is a care child like a care bear?
Every child needs care.
It is a good child care facility.

scott@ORA92> SELECT * FROM test_tab
  2  WHERE contains(resourceId_t, '{care} and {child} ', 1) > 0
  3  /

RESOURCEID_T
------------------------------------------------------------
We provide good care for your child.
Is a care child like a care bear?
Every child needs care.
It is a good child care facility.

scott@ORA92>

Previous Topic: Relevance rank within section weighting
Next Topic: Indexing Problem
Goto Forum:
  


Current Time: Thu Nov 21 11:53:14 CST 2024