How to configure collections in Adobe Search and Promote to support multiple environments through the same account?
By: Albin Issac
Tags: Software Development, Programming, Website, Adobe, Search

This tutorial explains the details on how to configure search collection in Adobe Search and Promote to support multiple environments through the same account.

Collection in Search and Promote

The collections can be used to allow customers to search specific areas of a website so that they can quickly find what they are looking for.

For example, customers can search a collection of URLs that are related to product sales or to support services.

Each collection is specified on a single line with a name and a URL mask. A URL mask can consist of the following:

• a full path such as http://www.mydomain.com/products.html

• a partial path such as http://www.mydomain.com/products

• a regular expression

To make a mask a regular expression, you insert the keyword regexp between the collection name and the URL mask e.g FAQs regexp ^.*/faqs

The IndexConnector URL entry points can be referenced to the collection as below

QA regexp index:test-feed*

Each line in the Collections field can contain only one URL mask. However, you can specify multiple URL masks for the same collection name on different lines.

Support http://www.yoursite.com/email_support/

Support http://www.yoursite.com/phone_support/

The collection=<Collection Name> e.g. collection=Support parameters specifies the collection to use for the search.This parameter maps to the sp_k backend search parameter, sp_k=<Collection Name> e.g. sp_k=Support

Configuring Collection

One of the best scenarios to use the collection is indexing the data for multiple environments e.g QA, UAT, etc into the same Adobe Search and Promote account, the collection parameters can be used to search the documents specific to the environment.

I am using the IndexConnector as a URL entry point to index the data through XML feed files but the URL entry points can be a website URL with links.

Refer to the below URL for more details on configuring Index Connector.

Refer the below URL for details on enabling custom JSON presentation and Transport templates

Let us now configure the collections to support QA and UAT environments search through the same Search and Promote account.

As a first step configure the index connector for both QA and UAT environments with environment-specific feed file.

product_QA.xml



<channel>

<title>Product Feed</title>

<Item>

<link>

<title>

<![CDATA[Book Prod1 Title]]>

</title>

<description>

<![CDATA[<p>Prod1 description</p>]]>

</description>

<productType>Book</productType>

<ProductId>prod1</ProductId>

<imageUrl>/content/dam/Images/product/prod1.jpg</imageUrl>

</Item>

<Item>

<link>

<title>

<![CDATA[Book Prod2 title]]>

</title>

<description>

<![CDATA[<p>Prod2 description</p>]]>

</description>

<productType>Book</productType>

<ProductId>prod2</ProductId>

<imageUrl>/content/dam/Images/product/prod2.jpg</imageUrl>

</Item> http://www.w3.org/2001/XMLSchema " version="2.0"> Product Feed https://qa.example.com/product-title/p/prod1 Prod1 description]]> Book prod1 /content/dam/Images/product/prod1.jpg https://qa.example.com/product-title/p/prod2 Prod2 description]]> Book prod2 /content/dam/Images/product/prod2.jpg

<link>

<title>

<![CDATA[Watch Prod3 Title]]>

</title>

<description>

<![CDATA[<p>Prod3 description</p>]]>

</description>

<productType>Watch</productType>

<size>10</size>

<ProductId>prod3</ProductId>

<imageUrl>/content/dam/Images/product/prod3.jpg</imageUrl>

</Item>

<Item>

<link>

<title>

<![CDATA[Watch Prod4 Title]]>

</title>

<description>

<![CDATA[<p>Prod4 description</p>]]>

</description>

<productType>Watch</productType>

<size>20</size>

<ProductId>prod4</ProductId>

<imageUrl>/content/dam/Images/product/prod4.jpg</imageUrl>

</Item>

</channel>

</feed> https://qa.example.com/product-title/p/prod3 Prod3 description]]> Watch 10 prod3 /content/dam/Images/product/prod3.jpg https://qa.example.com/product-title/p/prod4 Prod4 description]]> Watch 20 prod4 /content/dam/Images/product/prod4.jpg

product_UAT.xml



<channel>

<title>Product Feed</title>

<Item>

<link>

<title>

<![CDATA[Book Prod1 Title]]>

</title>

<description>

<![CDATA[<p>Prod1 description</p>]]>

</description>

<productType>Book</productType>

<ProductId>prod1</ProductId>

<imageUrl>/content/dam/Images/product/prod1.jpg</imageUrl>

</Item>

<Item>

<link>

<title>

<![CDATA[Book Prod2 title]]>

</title>

<description>

<![CDATA[<p>Prod2 description</p>]]>

</description>

<productType>Book</productType>

<ProductId>prod2</ProductId>

<imageUrl>/content/dam/Images/product/prod2.jpg</imageUrl>

</Item> http://www.w3.org/2001/XMLSchema " version="2.0"> Product Feed https://uat.example.com/product-title/p/prod1 Prod1 description]]> Book prod1 /content/dam/Images/product/prod1.jpg https://uat.example.com/product-title/p/prod2 Prod2 description]]> Book prod2 /content/dam/Images/product/prod2.jpg

<link>

<title>

<![CDATA[Watch Prod3 Title]]>

</title>

<description>

<![CDATA[<p>Prod3 description</p>]]>

</description>

<productType>Watch</productType>

<size>10</size>

<ProductId>prod3</ProductId>

<imageUrl>/content/dam/Images/product/prod3.jpg</imageUrl>

</Item>

<Item>

<link>

<title>

<![CDATA[Watch Prod4 Title]]>

</title>

<description>

<![CDATA[<p>Prod4 description</p>]]>

</description>

<productType>Watch</productType>

<size>20</size>

<ProductId>prod4</ProductId>

<imageUrl>/content/dam/Images/product/prod4.jpg</imageUrl>

</Item>

</channel>

</feed> https://uat.example.com/product-title/p/prod3 Prod3 description]]> Watch 10 prod3 /content/dam/Images/product/prod3.jpg https://uat.example.com/product-title/p/prod4 Prod4 description]]> Watch 20 prod4 /content/dam/Images/product/prod4.jpg

Enable the IndexConnector for both QA and UAT data feeds, Settings → Crawling →Index Connector

Add the IndexConnector configurations to the URL entry points, Setting → Crawling → URL Entrypoints, the URL entry points can be configured as environment-specific URL’s instead of IndexConnector

e.g

https://uat.example.com/search_index.html

https://qa.example.com/search_index.html

Configure the collection Settings → Searching → Collections, the collection can be also configured as environment-specific URL masks

e.g.

UAT https://uat.example.com/products

QA https://qa.example.com/products

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

The collections can be tested through the collection page “Test Collections” option

Specify the search index URL, the index URL can be taken from Reports → Data Views →Default View, for index connector, the URL is formed based on the primary key defined in IndexConnector definition(our case product id)

Let us now fetch the search result through URL

URL to fetch all the data without specifying the collection name — http://stage-xxxxxx.guided.ss-omtrdc.net/do=json&sp_staged=1&sp_q=*

This will display the data from both collection(QA and UAT)

The URL to fetch the data specific to UAT, this will return the data specific to UAT collection

http://stage-xxxxxxxx.guided.ss-omtrdc.net/do=json&sp_staged=1&sp_q=*&collection=UAT

The URL to fetch the data specific to QA, this will return the data specific to QA collection

http://stage-xxxxx.guided.ss-omtrdc.net/do=json&sp_staged=1&sp_q=*&collection=QA

The configuration can be pushed live after successful validation and run a live index, Index →Full Index →Live Index →Run Full Index

The URL to access live data http://xxxxxxxxxxx.guided.ss-omtrdc.net/do=json&sp_q=*&collection=QA

http://xxxxxxxxxxx.guided.ss-omtrdc.net/do=json&sp_q=*&collection=UAT

The search collection can be used to enable the user to search on a specific section of the website e.g products, materials, etc. The collection functionality can be also used to enable the search functionality for different environments(e.g QA and UAT) in the same Adobe Search and Promote Account.