Oracle Text (MOSC)

MOSC Banner

Count number of occurrences for a list of search terms

edited Nov 23, 2012 12:57AM in Oracle Text (MOSC) 1 commentAnswered
Anybody know how to count the number of ALL occurrences of a list of terms?

We have a table PROPERTY with an Oracle Text index on the DESCR column

I can count the actual number of occurrences of a term (e.g. ‘central heating’) by either

SELECT id, score(1)

FROM property

WHERE contains (descr,

               '<query>

              <textquery grammar="CONTEXT">

                "central heating"

             </textquery>

             <score datatype="INTEGER" algorithm="COUNT" />

           </query>',1) > 0;       

OR

SELECT id, score(1)

FROM property

WHERE contains(descr, 'DEFINESCORE ("central heating", OCCURRENCE)', 1) > 0;

 

PROBLEM:

I wish to sum up all the occurrences of a list of terms e.g. ‘central heating’ and ‘parking’

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center