CrafterCMS editorial blueprint shows the use of taxonomy for content targeting. Using the article's categories_o field, I can assign 0 to 4 categories. The Elasticsearch index for that field looks like this:
"categories_o" : {
"item" : [
{
"key" : "style",
"value_smv" : "Style"
},
{
"key" : "technology",
"value_smv" : "Technology"
}
]
},
How do I search articles with one or more categories?
The built-in categorization framework of Liferay creates an Elasticsearch index for a similar field like this:
"assetCategoryIds" : [ "644879", "644884", "644889", "6207544", "6207546", "6207550" ],
Then you can use the Elasticsearch query construct "terms" to search documents belongs to multiple (not just one) categories:
"query": { "bool": {
"must": { "match_all": {} },
"filter": {
"bool": {
"must": [
{"terms": {"assetCategoryIds": ["644889","6207550"]}},
...
I am looking for a way to do the same search in CrafterCMS.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…