Oracle Text Search on certain columns

1k Views Asked by At

How to use Oracle Text Search contains on multiple fields?

I would like to search only on emp_name and supervisor,so I have used the following query

SELECT * FROM fulltext_helper WHERE contains(indexme,'jack and  
jill(/HELPER/EMP_NAME/SUPERVISOR)') > 0;

However it didn't fetch any results.

How I can use certain columns from a table or materialized view to search with and without boolean operators.

1

There are 1 best solutions below

7
On BEST ANSWER

Giving the path "/HELPER/EMP_NAME/SUPERVISOR" tells him to search on leaf like "...", which doesn't exists; furthermore you shoud specify the INPATH operator.

The right syntax is:

CONTAINS(indexme,'jack INPATH(/HELPER/EMP_NAME) and jill INPATH(/HELPER/SUPERVISOR)') > 0;