DFS 9.1.0 - Solr
Important
This applies only to Sitecore 9+. For earlier versions, see link
After installing DAM For Sitecore, Solr has to be configured to accommodate custom DAM For Sitecore indexes:
- dfs_assets_master_index
- dfs_assets_web_index
This is configured doing the following
1 Create physical cores
To create the physical Solr cores, do the following:
- open file explorer on the server on which Solr is installed
- navigate to path <solr install dir>\solr-6.6.1-0\apache-solr\server\solr\configsets
- copy folder basic_configs into folder <solr install dir>\solr-6.6.1-0\apache-solr\server\solr
- rename to dfs_assets_master_index
- Repeat 1-4 for dfs_assets_web_index
2 Create cores in Solr UI
To create the cores in Solr UI, do the following:
- Open solr UI (e.g. https://127.0.0.1:8983/solr/)
- Go to Core Admin
- Add both cores (See screenshot below)
3 Populate cores
To populate Solr cores, do the following:
- Log into Sitecore
- Navigate to control panel
- Click Populate Solr Managed Schema
- Select both dfs indexes and press populate
4 Add DAM For Sitecore specific dynamic fields
To add DAM For Sitecore specifc dynamic fields, do the following:
- Open solr UI (e.g. https://127.0.0.1:8983/solr/)
- Select cores from core selector
- Under schema, add a new dynamic field with name as "*_lc" and field type lowercase
- Do this for both indexes
Please be aware that if you populate the managed schema after adding the dynamic field, then they are overwritten.
5 Changes in managed schema
Locate the managed-schema file under the 2 cores dfs_assets_master_index and dfs_assets_web_index you created in section 1.
- Check uniqueKey
Check the tag <uniqueKey> the value should be _uniqueid.
Sitecore 9.0.0 populates the managed schema with a wrong uniqueKey, so please double check that the <uniqueKey> tag does indeed contain the correct uniqueKey (it should be _uniqueid). - Change fieldtype "lowercase" to use another tokenizer
Locate the fieldtype lowercase, and change the tokenizer from solr.KeywordTokenizerFactory to solr.StandardTokenizerFactory.
Then restart the solr service.
See Sitecore documentation for for further information.
6 Searching with hyphen
To be able to search with hyphen, open then configurations file App_Config → Include → damforsitecore → DFS.Settings.config and locate the setting DFS.ContentSearch.FreetextSearch.ReplaceWithSpace. Add a hyphen to the value. like this:
<setting name="DFS.ContentSearch.FreetextSearch.ReplaceWithSpace" value="-" />