Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to configure Navigation Facet in Adobe Search and Promote?

How to configure Navigation Facet in Adobe Search and Promote?

The Facets can be used to customize your presentation layer and provide your users with a Guided Search that lets them drill down into their search results.
The website users can narrow down their search results with enabled facets, there are two types of facets in Search and Promote — Static and Dynamic, we are going to use Static facets for this tutorial.
Refer the below screen shot for example on the facets, the users can narrow down the search based on the brands they interested.


Facet Configuration

The meta data’s can be managed from Settings →Metadata →Definitions
adobe-search-and-promote-facet
adobe-search-and-promote-fccet

The metadata crawled and indexed through URL entry points — URL entry point can be a website URL or feed data through Index Connector, using Index Connector for this tutorial.
Refer https://www.albinsblog.com/2018/12/searchandpromote-crawlingindexconnector.html#.XvI2CGhKg2w for more details on configuring Index Connector.
The met data is ready now let us configure a facet based on the meta data defined “productType”
Navigate to Design →Navigation →Facets
adobe-search-and-promote-facet

Add a new Facet

adobe-search-and-promote-facet

Facet Name — Select the meta data filed based on which the facet should be defined.
Display Label — Enter display label
Behavior — there are different behaviors like Normal, Category, Category Multi-Select, Sticky and Multi-Select, I am going with Normal behavior for this tutorial
Normal — When a customer clicks a facet, whose behavior is set to Normal, it drills into the search results for that item. From there, the customer can further refine and narrow the number of search results.
Category — Category facets act like navigational elements. These facets are top-level facets that customers typically drill through before revealing facets with attribute options. Category facets do not narrow when other facets are selected and remain open. Clicking a different value within a category facet deselects all other facets on the page except for that category facet’s parents.
Category Multi-Select — facets are category facets that support the selection of multiple items from the facet where the items are “ORed” together.
Sticky — When a customer clicks a facet, whose behavior is set to Sticky, the facet with the selected option remains open during the drill-down. This option is useful when you want to let a customer changes a previous choice.
Multi-Select — Allows the selection of multiple items from a facet, where the items within the facet are “ORed” together. This option is useful for a facet that may show a minor attribute such as colors and you want to let the customer have the ability to build a query that lets them “show shoes in my size that are red or black”.
Show Always — For a normal or sticky facet, sets the facet to remain visible to the customer at all times. This option is only available if you selected Normal, Category, or Sticky from the Behavior drop-down list.
Refer the UI for details on other fields, I am only configuring the Facet Name and Facet Label for this tutorial, enable other fields as required.
Click Add, now the facet is enabled based on the meta data field “Product Type”

adobe-search-and-promote-facet

JSON Transport Template

Created a JSON template(custom_backend_json.tpl) with minimal data to support the search data
The new template can be added by navigating to Designs à Templates à Add Template
Select Template Type as Transport

adobe-search-and-promote-facet

Sample Template Content with minimal configuration– modify based on your requirement, even you can use the existing Transport Template with required customization

{
"general": {
"query" : "",
"total" : "",
"lower" : "",
"upper" : ""
},
"facets" : [
{
"name" : "productType",
"values" : [],
"counts" : []
}
],
"results" : [

{
"fields" :
[
{
"name" : "mdi",
"value" : ""
},
{
"name" : "title",
"value" : ""
},
{
"name" : "productType",
"value" : ""
}
]
}
,

]
}
Enabled with a single facet — update the template with additional required facets, also add the additional meta data’s and other configurations e.g. breadcrumbs, menus etc
e.g
"facets" : [
{
"name" : "productType",
"values" : [],
"counts" : []
},{
"name" : "facet2",
"values" : [],
"counts" : []
}
],

JSON Presentation Template

Created a JSON template(custom_presentaion_json.tmpl) with minimal data to present the search data to JSON

(
{
"general" :{
"query" : "",
"total" : "",
"page_lower" : "",
"page_upper" : "",
"page_total": ""
},
"facets" :
[
{
"label" : "",
"long" : truefalse,

"selected" : true,
"undolink" : "",

"values" :
[

{
"value" : "",
"selected" : "truefalse",
"count" : "",
"link" : "",
"undolink" : "",
"threshold" : truefalse
},

]
}


],
"results" :
[

{
"index" : "",
"title" : "",
"productType" : ""
},

]
}
)

Pre-Search Rule

Define a pre-search rule to configure the presentation and Transport template for the search, the rule is execute when the search request has a parameter “do=json”(the rule can be fired for every search request also)

adobe-search-and-promote-facet
adobe-search-and-promote-facet

The configurations are ready, let us now run a Stage indexing (note the configuration are not pushed to live yet)
Index →Full Index →Staged Index →Run Full Index

adobe-search-and-promote-facet

Access http://stage-xxxxxxxxxxx.guided.ss-omtrdc.net/do=json&sp_staged=1&sp_q=*
xxxxxxxxxxx — Search and Promote account number
This will respond with JSON data which contains the required facet and meta data details.
{
"general": {
"query": "",
"total": "3",
"page_lower": "1",
"page_upper": "3",
"page_total": "1"
},
"facets": [
{
"label": "productType",
"long": false,
"values": [
{
"value": "Sample1",
"selected": "false",
"count": "1",
"link": "?do=json;i=1;q1=Sample1;sp_q=*;sp_staged=1;x1=productType",
"undolink": "",
"threshold": false
},
{
"value": "Sample2",
"selected": "false",
"count": "1",
"link": "?do=json;i=1;q1=Sample2;sp_q=*;sp_staged=1;x1=productType",
"undolink": "",
"threshold": false
},
{
"value": "Sample3",
"selected": "false",
"count": "1",
"link": "?do=json;i=1;q1=Sample3;sp_q=*;sp_staged=1;x1=productType",
"undolink": "",
"threshold": false
}
]
}
],
"results": [
{
"index": "",
"title": "product-title",
"productType": "Sample1"
},
{
"index": "",
"title": "product-title",
"productType": "Sample2"
},
{
"index": "",
"title": "product-title",
"productType": "Sample3"
}
]
}
The configuration can be pushed live after successful validation and run a live index →Full Index →Live Index →Run Full Index

adobe-search-and-promote-facet

The URL to access live data http://xxxxxxxxxxx.guided.ss-omtrdc.net/do=json&sp_q=*
The facet data in the response can be used to present the filtering options to users to narrow down the website search.


This post first appeared on Albin's, please read the originial post: here

Share the post

How to configure Navigation Facet in Adobe Search and Promote?

×

Subscribe to Albin's

Get updates delivered right to your inbox!

Thank you for your subscription

×