Showing posts with label Adobe S&P. Show all posts
Showing posts with label Adobe S&P. Show all posts

Tuesday, June 23, 2020

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.
This tutorial explains the approach to configure the facets in Adobe Search & Promote.
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.
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
<search-content-type-header charset="UTF-8">
{
"general": {
"query" : "<search-query />",
"total" : "<search-total />",
"lower" : "<search-lower />",
"upper" : "<search-upper />"
},
"facets" : [
{
"name" : "productType",
"values" : [<search-field-value-list name="productType" quotes="yes" data="values" sortby="values" encoding="json" />],
"counts" : [<search-field-value-list name="productType" quotes="no" data="results" sortby="values" />]
}
],
"results" : [
<search-results>
{
"fields" :
[
{
"name" : "mdi",
"value" : "<search-display-field name="mdi" length="500" encoding="json" />"
},
{
"name" : "title",
"value" : "<search-display-field name="title" encoding="json" />"
},
{
"name" : "productType",
"value" : "<search-display-field name="productType" encoding="json" />"
}
]
}
<search-if-not-last>,</search-if-not-last>
</search-results>
]
}
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" : [<search-field-value-list name="productType" quotes="yes"  data="values" sortby="values" encoding="json" />],
            "counts" : [<search-field-value-list name="productType" quotes="no"  data="results" sortby="values" />]
        },{"name" : "facet2",
            "values" : [<search-field-value-list name=" facet2" quotes="yes"  data="values" sortby="values" encoding="json" />],
            "counts" : [<search-field-value-list name=" facet2" quotes="no"  data="results" sortby="values" />]
        }
    ],

JSON Presentation Template

Created a JSON template(custom_presentaion_json.tmpl) with minimal data to present the search data to JSON
<guided-content-type-header content="application/json" />
<guided-if-query-param-defined gsname="callback" /><guided-query-param gsname="callback" />(</guided-if-query-param-defined>
 {"general" :{
            "query" : "<guided-query-param gsname='q' />",
            "total" : "<guided-results-total />",
            "page_lower" : "<guided-results-lower>",
            "page_upper" : "<guided-results-upper>",
            "page_total": "<guided-page-total/>" 
        },  
        "facets" :
        [<guided-zone gsname="Facets_Default"><guided-facet  gsname="productType" >{ 
                        "label" : "<guided-facet-display-name gsname="productType" />",
                        "long" : <guided-if-facet-long>true<guided-else-facet-long>false</guided-if-facet-long>,
                        <guided-if-facet-selected>
                        "selected" : true,
                        "undolink" : "<guided-facet-undo-path gsname="productType" />",
                        </guided-if-facet-selected>
                        "values" : 
                        [
                            <guided-facet-values>
                            {
                                "value" : "<guided-facet-value  escape="ijson">",
                                "selected" : "<guided-if-facet-value-selected>true<guided-else-facet-value-selected>false</guided-if-facet-value-selected>",
                                "count" : "<guided-facet-count>",
                                "link" : "<guided-facet-value-path>",
                                "undolink" : "<guided-facet-value-undo-path>",
                                "threshold" : <guided-if-facet-value-equals-length-threshold>true<guided-else-facet-value-equals-length-threshold>false</guided-if-facet-value-equals-length-threshold>
                            }<guided-if-not-last>,</guided-if-not-last>
                            </guided-facet-values>
                        ] 
                    }
                    </guided-facet>
            </guided-zone>
        ],
        "results" :
        [ 
            <guided-results gsname="default">
            {
                "index" : "<guided-result-index />",
                "title" : "<guided-result-field gsname="title" escape="ijson" />",
                "productType" : "<guided-result-field gsname="productType" escape="ijson" />"
            }<guided-if-not-last>,</guided-if-not-last>
            </guided-results>
        ]
    }
<guided-if-query-param-defined gsname="callback">)</guided-if-query-param-defined>

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.

Wednesday, May 8, 2019

Adobe Search and Promote - Deep Dive

Adobe Search and Promote - Deep Dive

This video deep dive into Adobe Search and Promote


Thursday, December 6, 2018

How to use Attribute Loader in Adobe Search and Promote

How to use Attribute Loader in Adobe Search and Promote


This tutorial explains the details on how to use Attribute Loader in Adobe Search and Promote.

Attribute loader help us to provide additional meta data to the URL’s crawled from website.

For example, the PDF’s document crawled from the website will not have any additional metadata specified but the additional metadata can be loaded through Attribute Loader.

e.g while crawling the pdf document from website it will be possible to provide only pdf URL and file name but will not be able to provide the additional details like title, description etc, these additional metadatas can be provided via Attribute Loader.

The values will be merged during indexing through primary key value.

PDF URL Crawled from website — https://www.example.com/test/Albin.pdf

Additional Meta Data-

url- https://www.example.com/test/Albin.pdf(primary key)
Tittle — test PDF
Description — test PDF

The Attribute Loader is executed before actual indexing and the metadata data values are merged based on the primary key during indexing.

Adobe-search&promote-attribute-loader

Attribute Loader option is available under Settings → Metadata →Attribute Loader

Adobe-search&promote-attribute-loader

Add new Attribute Loader definition

Adobe-search&promote-attribute-loader

Sample Feed XML with additional meta data , the data should be available through any one of the following channel — HTTP(S),FTP, sFTP and File

The meta data for each PDF document is represented by Item tag in the XML data

<attributes xmlns:xs=”http://www.w3.org/2001/XMLSchema" version=”2.0">

<channel>

<title>Attribute Loader Feed</title>

<Item>

<title>test PDF1</title>

<desc>test PDF1</desc>

<url>https://www.example.com/test/Albin1.pdf</url>

</Item>

<Item>

<title>test PDF2</title>

<desc>test PDF2</desc>

<url>https://www.example.com/test/Albin2.pdf</url>

</Item>

</channel>

</attributes>

Enter the Feed details to the Attribute Loader

Adobe-search&promote-attribute-loader

Map the Feed data fields to the Adobe S&P meta data definitions, specify a primary key to map the attribute loader data with the data crawled from other channels e.g website. Here the PDF URL is considered as a primary key, the URL is available through both website and Attribute Loader feed.

The Attribute Loader data is merged to the document based on the primary key during the indexing.

Adobe-search&promote-attribute-loader

The Attribute Loader data can be previewed after configuration, to preview the Attribute Loader Data — Click on Load Attribute Loader Data then Start Load

Adobe-search&promote-attribute-loader
Adobe-search&promote-attribute-loader

Click on Start Load, this will show the preview of the data loaded from the feed

Adobe-search&promote-attribute-loader

Make sure the Content-Types for the required document types(e.g application/pdf) are selected to enable the crawler to crawl those document types from website — the documents for those the Content Types enabled will be crawled from the website

The Content Types can be enabled from Settings → Crawling →Content Types

Adobe-search&promote-attribute-loader

Configure the URL entrypoint — website URL from where the documents should be crawled and the URL mask — the matching URL that should be considered for crawling.

Settings →Crawling →URL Entrypoints

Adobe-search&promote-attribute-loader

The URL mask can be enabled from Settings →Crawling →URL Masks

Adobe-search&promote-attribute-loader

Sample URL

https://www.example.com/home.html

<html>

<body>

<a href=”https://www.example.com/test/Albin1.pdf">test1 pdf

<a href=”https://www.example.com/test/Albin2.pdf">test2 pdf

</body>

</html>

Run the live index by configuring the website URL entrypoint that has the reference to PDF documents, now the search result displays the metadata provided by Attribute Loader for PDF documents

The Attribute Loader is not enabled by default, this should be enabled in S&P account by your Adobe account representative or by Adobe Support.

The attribute loaders add the capability to provide additional meta data to the documents crawled through a channel that is enabled with limited data.