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

Home -> Community -> Usenet -> c.d.o.misc -> Re: how to search multiple columns?

Re: how to search multiple columns?

From: <jimi_xyz_at_hotmail.com>
Date: 27 Jul 2005 06:28:38 -0700
Message-ID: <1122470918.477742.324170@g14g2000cwa.googlegroups.com>


Stephen O'D,
Im not to sure on what your telling me. I figured out how to create a index on multiple columns, but now my problem is i need to know what column that word was found..

I used ctx_ddl.set_attribute('ctxsys.­my_multi', 'columns', 'title, objective, scope,approach'); to set the multiple column index. I then created the index doing this..

SQL>create index idx_all

   on project(ctx_dummy)
   indextype is ctxsys.context
   parameters ('datastore ctxsys.my_multi')    /

i then am able to query all for columns, example..

SQL> select score(1) score, projectid from project where contains(ctx_dummy, 'research', 1) >0 order by score desc;

the query looks like this, which is ok... but..

   SCORE PROJECTID
-------- ----------

      78       1380
      58       2332
      58        133
      52       1142
      45       2055
      39       2084
      39         40
      32       1748
      32        259
      32        255
      26        607


   SCORE PROJECTID
-------- ----------

      26        138
      26         72
      26         79
      19       2053
      19         16
      19         68
      19       1924
      19       1734


But i also need to have the query give me the column it found the word,

i queried for.

Example of desired output..

 SCORE PROJECTID COLUMN
-------- ---------- ----------

      26        138  objectives
      26         72  scope
      26         79  objectives
      19       2053  title
      19         16  title
      19         68  objectives
      19       1924  approach
      19       1734  scope


Any ideas will help.

Thanks inadvance,
Jimmie Received on Wed Jul 27 2005 - 08:28:38 CDT

Original text of this message

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