SearchBlox AEM Package
SearchBlox AEM Package
The SearchBlox AEM Package ensures that the AEM collection stays in real-time sync with ongoing site page updates, such as content changes, creation of new pages, or deletion and unpublishing of existing pages, without re-indexing the entire collection. It also integrates SearchBlox search with AEM site pages. To enable this functionality, the SearchBlox AEM package needs to be deployed and the required SearchBlox properties must be configured.
Install SearchBlox AEM Package and Verify Installation
- Download the SearchBlox AEM Package
- Click Hammer Icon → Deployment → Packages

- Click on Upload Package and select 'Force Upload' as shown in the reference below:

- Select it and then install it once the SearchBlox AEM package upload is complete.

After installing the SearchBlox AEM custom package, check the Activity log to view the status of installed nodes as shown in the reference below:

Configure AEM Collection with SearchBlox AEM Package
- Navigate to Config Manager →
http://localhost:4502/system/console/configMgr - Search for
SearchBlox Collection Configurationin the browser.

- Click SearchBlox Collection Configuration

-
Configure the properties listed below,
- SearchBlox URL → SearchBlox Instance URL
- Collection Name → AEM Collection Name
- API Key → SearchBlox API key
- Private Key → SearchBlox User SB-PKey for secure communication
-
Once the Configuration is complete, click on the Save button to save the SearchBlox Configuration.
Configure AEM Package Package Crawler
-
The AEM Package crawler triggers indexing for the configured AEM collection. First, create a System User authorized to perform crawl activity.
- To create the System User, go to AEM URL:
http://localhost:4502/crx/explorer/index.jsp - Click on User Administration and select Create System Useras shown below:
- To create the System User, go to AEM URL:

- Set the UserID with a unique username (e.g.,
sbadmin) and set the Intermediate Path as/home/users/system. - Click the Done icon to save.
- Configure privileges for the System User:
- Go to
http://localhost:4502/useradmin - Search for the System User username
- Double-click the username to open settings
- Go to the Permissions tab
- Enable Read, Modify, Create, Delete, Read ACL, and Edit ACL for the Content node
- Click Save to add the privileges as per the reference image below:

- Configure the Service Mapper to connect the Package Crawler with the System User Go to
http://localhost:4502/system/console/configMgrin your browser- Search for Apache Sling Service User Mapper Service Amendment and expand it
- Configure `com.searchblox.aem.core:getResourceResolver=sbadmin' (Here sbadmin is considered as System User. Actual Syntax format is: 'Symbolicname of the project:servicetype=System User')
- Once configured the Amendment, click on Save. Service Amendment will get added to its list.

After configuring the System User, ensure the SearchBlox Collection component is properly set up.
- Use the package crawler endpoint to start indexing the SearchBlox AEM Collection.
http://localhost:4502/bin/searchblox/aem/index

- You can use the below package crawler endpoint to stop SearchBlox AEM Collection Indexing:
http://localhost:4502/bin/searchblox/aem/index/stop

Configure AEM Search with SearchBlox AEM Package
Choose either Author or Publisher domain for Search Component configuration (example below uses Author Domain).
- Go to Config Manager: http://localhost:4502/system/console/configMgr
- Search for SearchBlox Search Configuration.
- Edit the configuration to set your Search URL.

- Enter your domain search URL without a trailing slash.

- After completing the configuration, click Save to save the SearchBlox settings.
- Access the SearchBlox AEM search page at:
http://<Author or Publisher Domain>/content/searchblox/search.html.
`
Note:
- Please ensure your search page domain is configured with the allowed CORS configuration.
- Please make sure to configure 'PluginDomain' in your Custom search UI Folder > facet.js file.
- Please ensure to access the below URLs in your browser if you see an API Failed error with Search Page access.
https://DNS:8443/rest/v2/api/secured/enabled
https://DNS:8443/ui/v1/search/settings
- You can further customize the search and update the Search Integration code with AEM site pages using Visual Editor or Developer Mode.
Customize Search Template using SearchBlox Embed Search Code:- Go to AEM home page:
http://localhost:4502/aem/start.html - Click Sites → Select SearchBlox AEM → Search → Click Edit.
- Go to AEM home page:
- Visual Editor Update:

- Developer Mode Update:
Use Developer Mode Edit Option or Navigate tohttp://localhost:4502/crx/de/index.jsp


You can update the existing HTML search integration code. Click on Save All to save the changes.

Note: In the HTML code body section, below script tags should be there:
<script data-sly-use.info="com.searchblox.aem.core.SearchBloxSearchConfiguration" src="${info.getPluginUrl}/facet.js"></script>
<script data-sly-use.info="com.searchblox.aem.core.SearchBloxSearchConfiguration" src="${info.getPluginUrl}/build.js"></script>
- Save your Embed Search Code and republish the Search Page.
Uninstall SearchBlox AEM Package
- Uninstallation is needed if the package was installed incorrectly or if you want to update the existing SearchBlox AEM Package.
- Navigate to Packages → Click Hammer Icon → Deployment → Packages.

- Select searchblox-aem.ui apps package → More → Uninstall

- Once the SearchBlox AEM Package uninstallation is complete, click on More and select Delete Option.

Once the SearchBlox AEM Package is installed and collection is set up, a new document is added to the collection whenever a site page is published.
When a site page is unpublished or deleted, the document is removed from the SearchBlox AEM Collection.
The package also updates meta content or page content in the SearchBlox AEM Collection.
SearchBlox AEM Package Logging
The package status log is available under the Author deployedlogs folder as searchblox.log.
The log provides information about all package actions and detailed Package Crawler status for each AEM document.

Note:
Follow this order to remove the SearchBlox AEM Package:
First, Uninstall the Package
Then, Delete the Package
If the package is deleted before uninstalling, the SearchBlox AEM Package will continue running on the Author Instance.
Updated 4 months ago
