Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: "google search" using Oracle Text

Re: "google search" using Oracle Text

From: Ivan Chow <ichow2_at_hotmail.com>
Date: Mon, 19 Apr 2004 07:28:53 -0400
Message-ID: <BAY12-F81SKqGABtvNL0005631c@hotmail.com>


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_at_db-nemec.com>
>Reply-To: oracle-l_at_freelists.org
>To: <oracle-l_at_freelists.org>
>Subject: Re: "google search" using Oracle Text
>Date: Mon, 19 Apr 2004 08:38:46 +0200
>
>
>----- Original Message -----
>From: "Ivan Chow" <ichow2_at_hotmail.com>
>To: <oracle-l_at_freelists.org>
>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_at_freelists.org
>put 'unsubscribe' in the subject line.
>--
>Archives are at http://www.freelists.org/archives/oracle-l/
>FAQ is at http://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_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Mon Apr 19 2004 - 06:25:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US