[ 
https://issues.apache.org/jira/browse/OAK-8971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17085057#comment-17085057
 ] 

Thomas Mueller commented on OAK-8971:
-------------------------------------

Patch for review. This is only implemented for the Lucene index currently. To 
enable the feature, add a property to be indexed, e.g.:

{noformat}
dynamicBoost = true (Boolean)
propertyIndex = true
name = jcr:content/metadata/predictedTags/.* (String)
isRegexp = true (Boolean)
{noformat}

That way, if a node jcr:content/metadata/predictedTags is added (for the 
indexed node type), then dynamic boost is used.
It will read the child nodes of that node (jcr:content/metadata/predictedTags) 
and for each node it will read:
* name (String)
* confidence (Double)

It will then add a field, for each token of the "name" property, with boost = 
confidence.

I added a test case to show how this can be implemented using the 
IndexFieldProvider. Unlike with the IndexFieldProvider, it is now possible to 
change the confidence or name of the predicted tag, if the node predictedTags 
is changed as well (for example, using a counter property there). This will 
cause the document to be updated in the index. With the IndexFieldProvider, 
this was not possible. (See also the test case that illustrates this).

> Indexing: dynamic boost, as an alternative to IndexFieldProvider
> ----------------------------------------------------------------
>
>                 Key: OAK-8971
>                 URL: https://issues.apache.org/jira/browse/OAK-8971
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: indexing
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Major
>         Attachments: OAK-8971.patch
>
>
> The org.apache.jackrabbit.oak.plugins.index.lucene.spi.IndexFieldProvider is 
> a callback that allows to change the behavior of indexing. There are multiple 
> problems:
> * (1) Not available using oak-run
> * (2) Only available for Lucene indexes
> Instead of a callback, a configuration option in the index property should be 
> added, such that the most commonly used features are available in oak-run, 
> and can be implemented in other indexes (e.g. Elastisearch, Solr).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to