Re: "google search" using Oracle Text

  • From: "Ivan Chow" <ichow2@xxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Mon, 19 Apr 2004 07:28:53 -0400

Jaromir, unless I'm missing something here, with OR, I would still need to 
build my contains clause. If the users' input string is "RAC Concepts and 
Administration",

select * from texttable;
TEXTID TEXT
---------- ----------------------------------------
         8 RAC - Real Application Clusters
         9 RAC Concepts and Administration
        10 Oracle9i DBA Administration
        11 Concepts manual
        12 Clustered Database Platform - RAC

select textid, text,score(1) from texttable where contains (text,'RAC 
Concepts and Administration',1)>1;
TEXTID TEXT                                         SCORE(1)
---------- ----------------------------------------         ----------
         9 RAC Concepts and Administration               5

I would like any occurrences of "RAC", "Concepts" and "Administration" to 
appear too but I only get one exact match returned above.

To get the rest of the records returned, I have to break up the input string 
into several OR's and build my SQL dynamically.

ie
select textid, text, score(1) from texttable where contains (text, 'RAC 
Concepts and Administration|RAC|Concepts|Administration',1)>1 order by 
score(1);
TEXTID TEXT                                          SCORE(1)
---------- ----------------------------------------          ----------
         8 RAC - Real Application Clusters                    5
         9 RAC Concepts and Administration                5
        10 Oracle9i DBA Administration                       5
        11 Concepts manual                                     5
        12 Clustered Database Platform - RAC             5

Now, I have all the records returned. However, the second issue I have is 
"RAC Concepts and Administration" is not listed first. Records with the 
exact string match should be listed first.

Any idea how I can execute an Oracle Text query without having to 
dynamically building the OR clause and also displaying records with the 
exact match first? I believe Oracle Text should be able to easily handle 
that but I just do not know how.

Thanks again.

Ivan

>From: "jaromir nemec" <jaromir@xxxxxxxxxxxx>
>Reply-To: oracle-l@xxxxxxxxxxxxx
>To: <oracle-l@xxxxxxxxxxxxx>
>Subject: Re: "google search" using Oracle Text
>Date: Mon, 19 Apr 2004 08:38:46 +0200
>
>
>----- Original Message -----
>From: "Ivan Chow" <ichow2@xxxxxxxxxxx>
>To: <oracle-l@xxxxxxxxxxxxx>
>Sent: Monday, April 19, 2004 4:03 AM
>Subject: "google search" using Oracle Text
>
>
> >for example, if the search string is "Oracle Text", I would execute the
> >following queries to retrieve the relevant records:
> >select * from texttable where contains (text, 'Oracle Text')>1;
> >select * from texttable where contains (text, 'Oracle')>1;
> >select * from texttable where contains (text, 'Text')>1;
>
>to get a document with any of the query terms use OR (|)
>
>select * from texttable where contains (text, 'Oracle OR Text')>1;
>
>
>see
>http://download-west.oracle.com/docs/cd/B10501_01/text.920/a96518/cqoper.htm#1531
>
>
>regards
>Jaromir D.B. Nemec
>
>
>PS: Mladen - fire (on) your backup admin.
>
>
>----------------------------------------------------------------
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>----------------------------------------------------------------
>To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
>put 'unsubscribe' in the subject line.
>--
>Archives are at //www.freelists.org/archives/oracle-l/
>FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
>-----------------------------------------------------------------

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page ? FREE 
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: