SearchBlox AEM Package
SearchBlox AEM Package
SearchBlox AEM Package avoids re-indexing an entire collection when modifications are made to its documents. SearchBlox allows the AEM collection to be in real-time sync with ongoing site pages updates like changing the content, creating a new site page, deleting or unpublishing the existing site page. SearchBlox AEM Package will also integrate search with AEM site pages. To integrate the SearchBlox AEM package, we need to deploy the package to configure the SearchBlox properties.
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.
Once you successfully install the SearchBlox AEM custom package, you can check the Activity log for installed nodes status 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 Configuration
in 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
- AEM Package crawler can be used to trigger configured AEM collection indexing. The prerequisite is to create a 'System User' who is authorized to perform crawl activity.
- To create the System User navigate to AEM URL:
http://localhost:4502/crx/explorer/index.jsp
- Click on 'User Administration' and click on 'Create System user' as shown below:
- Configure the 'UserID' with unique username (Eg: sbadmin) and provide Intermediate Path as
/home/users/system
- Click on the Done icon to save the configuration.
- Now configure the user privileges to the System User by navigating to URL:
http://localhost:4502/useradmin
- Search for the System User username in the search
- Double click on the username to configure the privileges
- Select the Permissions tab
- Check “Read”, “Modify”, “Create”, “Delete”, “Read ACL”, “Edit ACL” for the Content node
- Click Save to add the privileges as per the reference image below:
- Configure Service Mapper to integrate Package Crawler with System User from
http://localhost:4502/system/console/configMgr
- In the 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 System User configuration, ensure the SearchBlox Collection component is configured.
- You can use the below package crawler endpoint to start SearchBlox AEM Collection Indexing:
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
You can choose an author or publisher domain to configure the Search Component depending on the requirement. Below is the example for Author Domain
- Navigate to Config Manager →
http://localhost:4502/system/console/configMgr
- Search for
SearchBlox Search Configuration
in the browser. - Configure your Search URL by editing 'SearchBlox Search Configuration'
- Provide your Domain search URL without a slash at the end as shown in the reference below:
- Once the Configuration is complete, click on the Save button to save the SearchBlox Configuration.
- Now, you can access the SearchBlox AEM search page using the link:
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. For example, with the SearchBlox AEM site page, we can edit/update Search widget code using Visual Editor or Developer Mode.
Customize Search Template using SearchBlox Embed Search Code:
i. Navigate to AEM home page (http://localhost:4502/aem/start.html)
ii. Click Sites and Select SearchBlox AEM -> Search then click edit.
- 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>
iii. Save your Embed Search Code and Republish the Search Page.
Uninstall SearchBlox AEM Package
Uninstallation can only be possible if the package installation has not been done correctly 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 installation and collection setup are done, the collection gets added with a new document whenever a new site page is published.
In the same way, whenever a site page gets unpublished or deleted from the content repository, the SearchBlox AEM Package will remove the document from the SearchBlox AEM collection.
SearchBlox AEM Package will also update meta content or site page content with SearchBlox AEM Collection.
SearchBlox AEM Package Logging
You can find SearchBlox AEM Package status log under Author 'deployedlogs' folder with the name 'searchblox.log'
The file searchblox.log gives the info about all Package actions. And detailed information about Package Crawler Status for each AEM Document.
Note:
You should follow the following order to remove the SearchBlox AEM Package
- Uninstall Package
- Delete the Package
SearchBlox AEM Package will still run on the Author Instance if the package is deleted before the Uninstallation.
Updated over 1 year ago