sqloracle-databaseoracle10goracle-textoracle-xml-db

Oracle Text Search on certain columns


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.


Solution

  • 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;