Search Functionality with Elasticsearch
Elasticsearch provides a performant way to query, filter, and sort on documents, such as items in the Crystallize Catalogue. Crystallize now has a native GraphQL search API you should use to provide search.
We have created a couple of Elasticsearch + Crystallize starter projects to provide you with a way to easily add search functionality to your store, while giving you an overview of how the Crystallize catalogue is structured.
The example projects can be found for the following languages:
In order to get started, clone the project you are wanting to use into your workspace.
For local development you can easily set up an Elasticsearch cluster using docker-compose. Navigate to the project folder and run the following command:
docker-compose up -d
This will create 3 Elasticsearch nodes in separate containers, with the main node being exposed on http://localhost:9200.
You can also create a deployment on Elastic Cloud which provides an easy set up for a production environment.