Extend search to include link type fields as facets – Extended

This is an ELINTS (Explain like I’m new to Sitecore) for a clear cut explanation on Sitecore’s own documentation here.

Prequel: You have a SXA search page. You needs to show some values that are reference fields that are selected with a Droplist or Multilist. By default if you add the facet it will show GUIDs.

enter image description here

You can search “facet showing guid” on stackexchange for answer and you will find it but if you are like me and not paying attention to it you will need this fine detail to make it work.

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
               xmlns:role="http://www.sitecore.net/xmlconfig/role/"
               xmlns:search="http://www.sitecore.net/xmlconfig/search/">
	<sitecore>
		<contentSearch search:require="solr">
			<indexConfigurations>
				<defaultSolrIndexConfiguration type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider">
					
					<documentOptions type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider">
						<fields hint="raw:AddComputedIndexField">
							<field fieldName="resourceindustry" returnType="stringCollection" type="Sitecore.XA.Foundation.Search.ComputedFields.ResolvedLinks, Sitecore.XA.Foundation.Search" referenceField="industry" contentField="title"/>
							<field fieldName="resourceregion" returnType="stringCollection" type="Sitecore.XA.Foundation.Search.ComputedFields.ResolvedLinks, Sitecore.XA.Foundation.Search" referenceField="region" contentField="title"/>
						</fields>
					</documentOptions>
				</defaultSolrIndexConfiguration>
			</indexConfigurations>
		</contentSearch>
	</sitecore>
</configuration>

the field needs to be defined in the documentOptions section. I was initially adding it to the fieldMap section and was scratching my head with vigor.

Just do it like above and use the new fieldName like below and you should be good to go.

~ Enjoy life as it is your own and no one else’ ~

Sitecore SXA search facet breaking up the words…

Have a Sitecore instance. Don’t want to pay for Coveo search but need search on your site.

The out of the box search is pretty cool. One sunny afternoon I was setting it up and ran into a snag.

I used a facet that had multiple words in it. Once you add that to the search page the words were getting broken up by space. Sitecore has a hotfix for it (here) but found a smaller solution.

Us this config. Make sure you adding the field to the solr indexes, and if you are using sxa search then make sure sxa_master and sxa_web index have these fields in there.

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
    xmlns:role="http://www.sitecore.net/xmlconfig/role/"
    xmlns:search="http://www.sitecore.net/xmlconfig/search/">
    <sitecore>
        <contentSearch search:require="solr">
            <indexConfigurations>
                <defaultSolrIndexConfiguration type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider">
                    <fieldMap type="Sitecore.ContentSearch.SolrProvider.SolrFieldMap, Sitecore.ContentSearch.SolrProvider">
                        <fieldNames hint="raw:AddFieldByFieldName">
                            <field fieldName="ResourceType" storageType="YES" indexType="UN_TOKENIZED" vectorType="NO" boost="1f" returnType="string" settingType="Sitecore.ContentSearch.SolrProvider.SolrSearchFieldConfiguration, Sitecore.ContentSearch.SolrProvider"/>
                        </fieldNames>
                    </fieldMap>
                </defaultSolrIndexConfiguration>
            </indexConfigurations>
        </contentSearch>
    </sitecore>
</configuration>

~ Stay Inside and Sitecore on ~

What the X is SXA?

 

<hr>

Install SXA

  1. Download package
  2. install PowerShell
  3. install SXA package

Setup Solr

  1. After installing SOLR and connecting it to your Sitecore instance, you may notice that a number of default Sitecore platform cores have been added. In SOLR a core is an instance of a Lucene index and contains the configurations for that index. Each index should have its own core, therefore for each custom index you wish to create for SXA, you must create a core.
  2. To create your SOLR SXA core:
    1. Duplicate core directory created for sitecore_master_index (or company_name_master_index) twice and rename to:
      1. sitecore_sxa_master_index
      2. sitecore_sxa_web_index
    2. In those two folders, remove everything besides the “conf” directory.
    3. On the Solr web interface, click Core Admin and click Add Core to add sitecore_sxa_master_index
    4. Make sure that the names of the Solr cores you created match the settings for sitecore_sxa_master_index and sitecore_sxa_web_index in Sitecore.XA.Foundation.Search.Solr.config
    5. In Sitecore, log in to the Launchpad and open the Control Panel.
    6. In the Indexing section, click Populate Solr Managed Schema.
    7. In the Schema Populate dialog box, Select sitecore_sxa_master_index and sitecore_sxa_web_index, and click Populate:
    8. In the Indexing section, click Indexing Manager.
    9. In the Indexing Manager dialog box, select sitecore_sxa_master_index and sitecore_sxa_web_index, and click Rebuild

The fun stuff

  • Create a site folder/tenant folder
    • create tenant
      • create site
    • Delete is not deleted, do “Remove Site”
  • Site Setup
    • Create Tenant
      • create site
      • Settings
        • config
        • Grid
  • system > settings > feature
    • create folder
    • create module
  • Layout > rendering
    • clone an existing rendering
    • create the view in code
  • fix the template
    • fields
  • template > branches > feature
    • clean up variant as its a copy

Other more useful resources…

https://doc.sitecore.com/developers/sxa/17/sitecore-experience-accelerator/en/create-and-change-a-partial-design.html

https://doc.sitecore.com/developers/sxa/17/sitecore-experience-accelerator/en/manage-multiple-sites-with-the-sxa-site-manager.html

https://www.sidewalk.be/articles/the-sitecore-sxa-journey-discover-tips-and-tricks-when-implementing-an-sxa-website

https://doc.sitecore.com/developers/sxa/17/sitecore-experience-accelerator/en/add-a-style-for-a-rendering.html

 

 

Sitecore with SXA: Creating item package but it’s not including media files…

“This one time in band camp”

I was packaging up items from once Sitecore instance to another…

Sitecore has SXA module installed and the site was set up very pretty. Just look at it…

Screen Shot 2018-09-12 at 4.27.33 PM.png

The site had the media library virtually set up in there, along with assets, presentation, and settings.

so, like any other noob, I packaged up the everything under home recursively and imported it to the destination Sitecore. But none of the Media library items actually made it in.

I had to package up actual Sitecore/Media Library item and it’s items then import it for all the images to show up.

Let me know if I am just being less smart or if I missed anything. How did you do it?

and if this helped you please subscribe to my channel and give me a like. Oh, wait, this is not youtube, Thank the CMS GOD.

 

~ Life is like youtube except for you can’t rewind or fast forward. ~