I have this query:
select id from mytable where contains(all_text,'('||?||' within name)*2,
('||?||' within description)',1)>0
How does the contains in the where clause work?
Thanks,
I have this query:
select id from mytable where contains(all_text,'('||?||' within name)*2,
('||?||' within description)',1)>0
How does the contains in the where clause work?
Thanks,
If the first parameter occurs in the name section, then its weight is twice the weight of the second parameter occurring in the description section.
This "contains" operator will set the score variable. Without it doubling the weight has no meaning for ">0" condition. However,
SELECT id FROM mytable WHERE CONTAINS(all_text,'('||?||' WITHIN name)*2,
('||?||' WITHIN description)',1)>0 ORDER BY SCORE(1) DESC
would totally make sense and will order id's first by those rows where search term is found in the name section.
Here is a useful reference, just in case: http://docs.oracle.com/cd/B19306_01/text.102/b14218/cqoper.htm