Indexed custom properties are automatically indexed as text or keyword, enabling you to use them for facets.
To use a property as a facet:
org.jahia.modules.augmentedsearch.content.indexedMainResourceTypes
and org.jahia.modules.augmentedsearch.content.mappedNodeTypes
properties. The following example shows adding the jacademix:document
definition type.
Now your data can be used in your queries. The following example show how to make a jacademix:document
mixin a main resource to be searched. The example also shows how to map it so that the author
property can be used for facets.
{
jcr {
searches(siteKey: "academy", language: "en", workspace: LIVE) {
search(q: "cluster", limit: 20, offset: 0,
filter: {nodeType: {type: "jacademix:document"}},
facets: {
term: [
{field:"author.keyword", minDocCount:1}]}) {
totalHits
took
facets {
field
type
data {
... on TermValue {
count
value
}
}
}
hits {
id
link
displayableName
excerpt
score
lastModified
lastModifiedBy
createdBy
created
}
}
}
}
}
Copyrights © 2002-2020 All Rights Reserved by Jahia Solutions Group SA