Documentation

Ucommerce includes full API reference documentation and lots of helpful articles to help you build your e-commerce site as effortlessly as possible.

Topics Payment Providers
v7.18

Getting started with Elasticsearch in Ucommerce

Setting up Elasticsearch

By default, Ucommerce will connect to Elasticsearch on http://localhost:9200

The easiest way to run Elasticsearch locally is using powershell and Chocolatey:

    
    
    cinst elasticsearch -y
    Start-Service -Name "elasticsearch-service-x64"
    
    

Or download and install manually from https://www.elastic.co/downloads/elasticsearch

How to enable the Elasticsearch search provider for Ucommerce

1) Find the Ucommerce Apps dir. Rename the dir namedUcommerce.Search.Lucene under Ucommerce app directory to Ucommerce.Search.Lucene.disabled

1) Rename Ucommerce.Search.ElasticSearch.disabled to Ucommerce.Search.ElasticSearch

1) Reset IIS or recycle your app pool.

1) Head to Ucommerce -> Settings -> Search and hit _Index everything from scratch_.

Additional steps when upgrading from from a prior Ucommerce version:

1) When Ucommerce is upgraded, all the configuration for the Ucommerce apps is replaced. In order to make sure you preserve your custom configuration, it should live in a separate app e.g. Ucommerce.Search.Elasticsearch.Avenue right next to our Ucommerce.Search.Elasticsearch app.

1) Ucommerce Index implementations are now provider-independent. If you inherited an existing index implementation, you will have to update your index to inherit the new Ucommerce.Search.Index<T> instead.

Before

    
    
        <component id="DefaultProductsIndex"
        service="Ucommerce.Search.IIndex`1[[Ucommerce.Search.Models.Product,  Ucommerce.Search]], Ucommerce.Search"
        type="Ucommerce.Search.Lucene.LuceneDiskIndex`1[[Ucommerce.Search.Models.Product,  Ucommerce.Search]], Ucommerce.Search.ElasticSearch">
            <forwardedTypes>
                <add service="Ucommerce.Search.IIndexAutomatically, Ucommerce.Search" />
            </forwardedTypes>
            <parameters>
                <Definition>${ProductsIndexDefinition}</Definition>
                <Fetcher>${ProductFetcher}</Fetcher>
            </parameters>
        </component>
        
    

After

    
    
        <component id="DefaultProductsIndex"
        service="Ucommerce.Search.IIndex`1[[Ucommerce.Search.Models.Product,  Ucommerce.Search]], Ucommerce.Search"
        type="Ucommerce.Search.Index`1[[Ucommerce.Search.Models.Product,  Ucommerce.Search]], Ucommerce.Search.ElasticSearch">
            <forwardedTypes>
                <add service="Ucommerce.Search.NonGeneric.IIndex, Ucommerce.Search" />
            </forwardedTypes>
            <parameters>
                <Definition>${ProductsIndexDefinition}</Definition>
                <Fetcher>${ProductFetcher}</Fetcher>
            </parameters>
        </component>
    
  • Ucommerce.Search.Lucene.LuceneDiskIndex is replaced by Ucommerce.Search.Index<T>.
  • The forwarded type Ucommerce.Search.IIndexAutomatically is replaced by Ucommerce.Search.NonGeneric.IIndex