Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using the matching score of oracle text within SEM_MATCH (orardf:textContains)

3054700Mar 9 2016 — edited Mar 10 2016

I'm applying a filter in a SEM_MATCH query using the orardf:textContains operator this way:

SELECT s, p, o

FROM TABLE(SEM_MATCH( '

SELECT ?s ?p ?o

WHERE

{ ?s ?p ?o

  FILTER (orardf:textContains(?o, "fuzzy(search_string_1, 70, 1)"))

}',

SEM_Models('model'),

NULL,

NULL,

NULL));

Now I would like to filter by more than one string and order results by number of keyword matched. Something like this:

SELECT s, p, o, scr

FROM TABLE(SEM_MATCH( '

SELECT ?s ?p ?o (score(1) as ?scr)

WHERE

{ ?s ?p ?o

  FILTER (orardf:textContains(?o, "fuzzy(search_string_1, 70, 1) ACCUM fuzzy(search_string_2, 70, 1)", 1))

}

ORDER BY ?scr',

SEM_Models('model'),

NULL,

NULL,

NULL));

I was hoping to use the optional third argument of orardf:textContains as a label to be referenced in the SCORE operator (such as in the CONTAINS operator of Oracle Text) but I couldn't figure out how to use it since the score function is not defined in that context.

Is there a way to achieve this?

Thank you

Fred

This post has been answered by 3054700 on Mar 10 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2016
Added on Mar 9 2016
1 comment
869 views