Elastic Search Configuration

From Znode Knowledge Base
Jump to: navigation, search

Before start with elastic search system must have “Jdk-8u102-windows-x64.exe (configure with system variables)” and elasticsearch-2.3.1.

Once you installed JDK(with environment variable) you will need to configure Elasticsearch. To configure the Elasticsearch:

  1. Run cmd as administrator
  2. Go to directory where the “elasticsearch-2.3.1” is located
  3. Copy location path and paste in cmd

  4. EL.png


  5. Type “service” (a batch file provided by Elastic Search) and press "Enter". Options are now displayed.
  6. Type “install” ahead and hit the "Enter" button to install Elasticsearch service.

Is Elasticsearch Running?

To verify if Elasticsearch is running or not, go to a browser and enter “localhost:9200” and hit the enter button-- refer below to screenshot.

EL1.png

Creating Search Indexes

Search indexes can be created for a Store’s Products in its Catalog. Each Store will have separate Indexes.

If there is any changes made in published data, search indexes needs to be created for it to be seen on Webstore.

While creating a new Store, an Index will be automatically created for the Products associated to its Catalog. Also, whenever we Publish a Catalog, Indexes will be created for all the Stores to which they are associated.

In the above scenario, if you get an error saying “Please create index manually”, then an index with a different name code is already present on your system. In this case, you will have to create index for the store manually with a proper index name.


EL2.png


Creating Indexes for a Store

 Marketing -> Site Search -> "Create Index" button -> {Select Store} -> "Create Index" button

You will be able to see the status as started in the list below. You will have to refresh the list to check the “Complete” status of creating index for the store.

The index creation status will show following values:

Detail Description
Started Index creation is started for the Store
In Progress Index creation for the Store is in progress.
Complete Index creation for the store is completed successfully
Failed Some error must have occurred while creating search index

A scheduler can also be registered using this page, which can be used to create search Index repeatedly using “Create Scheduler” button.

Znode.Engine.SearchIndexer .exe

"..\Znode.Engine.Api\Data\SearchIndexer"

This executable file is responsible for calling create index API.

Search Index Error Logging

If the Seach Index Status has “Failed”, check the following log files:


Znode_Search_Log

“..\Znode.Engine.Api\Data\default\logs\{date when the error occurred}.”

This file will give you information about which exception must have occurred depending on the which create index process failed.

This file will also give you information whether the index creation for the Store is "Started" or is "In Progress".


SearchIndexLogs

“..\Znode.Engine.Api\Data\SearchIndexer”

This file will give information about the current status of the API called from Znode.Engine.SearchIndexer.exe.


Configuration Settings for the Znode

   <add key="UseCustomAnalyzer" value="true" />
   <add key="UseSynonyms" value="true" />
   <add key="DefaultTokenFilters" value="lowercase" />


For Znode configuration, the basic level setting is put in the web.config from Znode.Engine.Api project. These setting help us for:

Detail Description
UseCustomAnalyzer If set to "True", we can use a custom analyzer with user defined filters and tokenizers. Otherwise, the default analyzer will be used.
DefaultTokenFilters Values must be separated by comma(s). Default token filters available: "standard,asciifolding,uppercase,length,nGram,edgeNGram,porter_stem,shingle,word_delimiter,etc."
UseSynonyms If set to true, synonyms can be used for search terms.

Boosting Search Results

Boosting is used to by Ecommerce website to show more relevant products at the top of the search result. In Znode we support three levels of Boosting:

Detail Description
Product-Level Boosting applied at the Product-level. This boosting is applied when a global-level search is performed.
Category Level Boosting Boosting Products on Category Pages has two variables, Product and Category Boosts. If a Product does not have a Category Boost Value, Znode will check for a Product Boost Value. Category-Level Boosts take precedence over Product-Level Boosts.
Field-Level Boosting Boosting applied to searchable fields. If we want to Boost Search Results according to the content of the searchable fields, then Field-Level Boosting can be used.

Related Links