-
Notifications
You must be signed in to change notification settings - Fork 9
SearchServer
The main Nucleus component an application will use is called SearchServer and its configuration is defined at
org/opencommercesearch/SearchSever.properties
The following table describes some properties of this component
Property Name | Description | Values | Required |
---|---|---|---|
class | SearchServer implementation | org.opencommercesearch.CloudSearchServer org.opencommercesearch.EmbeddedSearchServer | Yes, unless you're overriding the default configuration file |
scope | Leave this parameter as global scope for most use cases | global (default) session request | Yes, unless you're overriding the default configuration file |
searchRepository | The ATG repository for search artifacts. You shouldn't need to change this value | /org/opencommercesearch/repository/SearchRepository | Yes |
synonymRql | The RQL statment to load synomyms from the repository | ALL | Yes |
ruleCountRql | The RQL statment to retrive the number of rules in the repository | ALL | Yes |
ruleRql | The RQL statment to load the rules from the repository | ALL ORDER BY id RANGE ?0+?1 | Yes |
ruleBatchSize | The batch size to load rules from the repository | 2000 | Yes |
By default, OpenCommerceSearch will launch an embedded Solr instance. This is a good option for development environments. The jar already contains a set of default configuration files.
The default configuration file looks like this:
$class=org.opencommercesearch.EmbeddedSearchServer
solrConfigUrl=/solr/solr_preview.xml
solrCorePath=solr
dataDir=/opt/search/data
inMemoryIndex=true
catalogCollection=catalogPreview
ruleCollection=rulePreview
searchRepository=/org/opencommercesearch/repository/SearchRepository
synonymRql=ALL
ruleCountRql=ALL
ruleRql=ALL ORDER BY id RANGE ?0+?1
ruleBatchSize=2000
The following table describes the EmbeddedServer properties
Property Name | Description | Out of the Box Values | Required |
---|---|---|---|
solrConfigUrl | This is the URL to the Solr main configuration file in the classpath | /solr/solr_preview.xml /solr/solr_public.xml | Yes |
solrCorePath | OpenCommerceSearch uses multiple cores, this preporty point to Solr home path. The path can be a physical directory a or resource path. | solr | Yes |
dataDir | The directory to store the index files. If inMemory is set to true this property is ignored | /opt/search/data | No |
inMemoryIndex | Indicate if the indexes are store in memory or in a persistent storage | true false (default) | No |
You can also run the Embedded Instance with an in-memory index. This is very helpful for integration and automated tests. To run the indexes in memory can create your custom SearchServer.properties and set the inMemoeryIndex to true. For example:
inMememoryIndex=true
All other parameters will be inherited from the default property file.
For non-development environments you will need to run you own instances of Zookeeper and Solr, How to deploy SolrCloud is out of the scope of this document. To connect OpenCommerceSearch to SolrCloud you can create a configuration file like this:
$class=org.opencommercesearch.CloudSearchServer
host=<zookeeper>:<port>
This file overwrites the default implementation class to use the cloud implementation. This class add another required property called host that should point to your Zookeeper Ensemble load balancer. All EmbeddedServer properties are ignored.