Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Intermedia Query Question
In article <ea603f8d.0407150720.a30896c_at_posting.google.com>, Ronnie
says...
> Hi,
>
> I have a table such that
>
> SQL> desc testtable
> Name Type Nullable Default Comments
> ----- ------------ -------- ------- --------
> DUMMY VARCHAR2(50) Y
>
> SQL> select * from testtable
> 2 /
>
> DUMMY
> --------------------------------------------------
> tom
> trisha
> nancy
> tom trisha
> nancy trisha
> nancy tom
> tom nancy
> tom nancy trisha
> trisha tom nancy
>
>
> I create an intermedia textindex on the table using the command
>
>
> create index testindex on testtable(dummy) indextype is
> ctxsys.context;
>
>
> Now when i issue a query such as
>
>
> SQL> select * from testtable where contains (dummy,'anurag trisha')>0;
>
> DUMMY
> --------------------------------------------------
> tom trisha
>
>
> It matches the whole string. The results I am expecting is
>
> DUMMY
> --------------------------------------------------
> tom trisha
> tom nancy trisha
> trisha tom nancy
>
> That is in the beginning it should list the records wherever tom
> trisha exist next to each other and later at the end it should bring
> all the records where both tom and trisha exist even though they are
> not next to each other.
>
> Please suggest.
Well I don't see the value 'anurag' anywhere in your data so don't understand how you got any rows back at all. Unless I am being very thick.
Simply:
contains(dummy,'a b') >0
contains(dummy,'a,b') >0
contains(dummy,'a or b') >0
There is a whole chapter on how all this works somewhere in the documentation (not sure which maual it resides in).
hope that is slightly helpful
-- jeremyReceived on Thu Jul 15 2004 - 10:58:28 CDT
![]() |
![]() |