Boost configuration for jcr-sql2 querying with lucene index
Good morning
I am modifying a query to boost results on a pages when a "Master tag" is found in cq:tags or a masterTag property. I am running 6.5.14.0
My (simplified) query is as follows:
Select * FROM [cq:Page] AS story WHERE ISDESCENDANTNODE(story,'/content/test-uc/news/articles') AND( CONTAINS(story.[jcr:content/cq:tags],'"blog:college-prep/paying-for-college"^2 OR "blog:college-prep"^5 OR "blog:college-prep/choosing-a-major"^2') OR CONTAINS(story.[jcr:content/masterTag],'"blog:college-prep"^10') )ORDER BY story.[jcr:score] desc
I have an index for these pages, and have checked the query performance diagnostic to ensure that it is using this index. I have also reindexed several times to ensure that the index us up to date with the config.
newsSearch: {
"jcr:primaryType": "oak:QueryIndexDefinition",
"compatVersion": 2,
"includedPaths": [
"/content/uc/news/articles",
"/content/test-uc/news/articles"
],
"name": "News Search",
"seed": 7725922112693290843,
"type": "lucene",
"async": "async",
"evaluatePathRestrictions": true,
"reindex": false,
"reindexCount": 5,
"indexRules": {
"jcr:primaryType": "nt:unstructured",
"cq:Page": {
"jcr:primaryType": "nt:unstructured",
"includePropertyTypes": "all",
"properties": {
"jcr:primaryType": "nt:unstructured",
"jcrTitle": {
"jcr:primaryType": "nt:unstructured",
"ordered": false,
"propertyIndex": true,
"analyzed": true,
"name": "jcr:content/jcr:title",
"type": "String"
},
"author": {
"jcr:primaryType": "nt:unstructured",
"ordered": true,
"propertyIndex": true,
"name": "jcr:content/author",
"type": "String"
},
"isEmergency": {
"jcr:primaryType": "nt:unstructured",
"nullCheckEnabled": true,
"ordered": false,
"propertyIndex": true,
"name": "jcr:content/isEmergency",
"type": "Boolean"
},
"isEvent": {
"jcr:primaryType": "nt:unstructured",
"nullCheckEnabled": true,
"ordered": false,
"propertyIndex": true,
"name": "jcr:content/isEvent",
"type": "Boolean"
},
"hideInNav": {
"jcr:primaryType": "nt:unstructured",
"nullCheckEnabled": true,
"ordered": false,
"propertyIndex": true,
"name": "jcr:content/hideInNav",
"type": "Boolean"
},
"slingresourceType": {
"jcr:primaryType": "nt:unstructured",
"ordered": false,
"propertyIndex": true,
"name": "jcr:content/sling:resourceType",
"type": "String"
},
"nodeName": {
"jcr:primaryType": "nt:unstructured",
"ordered": true,
"propertyIndex": true,
"analyzed": true,
"name": ":nodeName",
"type": "String"
},
"dispDate": {
"jcr:primaryType": "nt:unstructured",
"ordered": true,
"propertyIndex": true,
"name": "jcr:content/dispDate",
"type": "Date"
},
"cqModified": {
"jcr:primaryType": "nt:unstructured",
"ordered": false,
"propertyIndex": true,
"name": "jcr:content/jcr:lastModified",
"type": "Date"
},
"cqTags": {
"jcr:primaryType": "nt:unstructured",
"nodeScopeIndex": true,
"ordered": false,
"propertyIndex": true,
"analyzed": true,
"name": "jcr:content/cq:tags",
"type": "String"
},
"masterTag": {
"jcr:primaryType": "nt:unstructured",
"nodeScopeIndex": true,
"ordered": false,
"propertyIndex": true,
"analyzed": true,
"name": "jcr:content/masterTag",
"type": "String"
},
"onTime": {
"jcr:primaryType": "nt:unstructured",
"ordered": false,
"propertyIndex": true,
"name": "jcr:content/onTime",
"type": "Date"
},
"offTime": {
"jcr:primaryType": "nt:unstructured",
"ordered": false,
"propertyIndex": true,
"name": "jcr:content/offTime",
"type": "Date"
}
}
}
}
}
When I run the query, it finds the correct set of stories based on CONTAINS() but none of the boosts in teh query are applied. All of them end up with the same score, as in this screenshot of the list component with my debug data exposed
Based on the query above, with "College Prep" being queried as the masterTag, I believe that the #2 story should appear first (in addition to the scores being different).
I have never used boosting before, so I am thinking this is developer error, but I can't determine what I'm missing. My index has analyzed and nodeScopeIndex set to true for both cq:tags and masterTag, and explain query shows that fulltextqueries are read agains the CONTAINS constraints in the query.
As an alternative to in-query boosting, I have also tried boosting the properties on the index, as well, but no dice. I've combed through just about every piece of documentation and discussion from the last decade on this, and I've hit a wall. I would appreciate some advice.