Can we add custom facets from custom/meta fields in faceted search

Yes, we can add custom facets using custom fields that has been indexed from meta tag, property fields, entity and sentiment fields in faceted search.

Step 1: 

Stop SearchBlox

Step2:

Add the field in ../webapps/searchblox/WEB-INF/mapping.json

eg: add the following snippet in mapping.json for each custom field, please give the name of the custom field in the beginning 

"custom": {
"type": "text",
"store": "yes",
"index": "analyzed",
"analyzer": "sb_analyzer",
"include_in_all": "false"
},

Step 3:

Add the facet in ../webapps/searchblox/plugin/index.html at around line number 100 as below

facets: [

{'field': 'custom', 'display': 'Custom Field'},
{'field': 'contenttype', 'display': 'Content Type'},
{'field': 'keywords', 'display': 'Keywords'},
{'field': 'colname','display': 'Collection'}
]

 Step 4:

Start SearchBlox

 

 

Have more questions? Submit a request

Comments