{"id":21043438,"url":"https://github.com/crystallizeapi/crystallize-elasticsearch-example-js","last_synced_at":"2026-04-22T08:30:59.719Z","repository":{"id":42894649,"uuid":"253745358","full_name":"CrystallizeAPI/crystallize-elasticsearch-example-js","owner":"CrystallizeAPI","description":"An example service integrating ElasticSearch with Crystallize.","archived":false,"fork":false,"pushed_at":"2022-12-12T10:06:04.000Z","size":544,"stargazers_count":0,"open_issues_count":9,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-12-29T02:14:07.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrystallizeAPI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-07T09:20:50.000Z","updated_at":"2020-04-15T08:18:01.000Z","dependencies_parsed_at":"2023-01-27T17:30:44.205Z","dependency_job_id":null,"html_url":"https://github.com/CrystallizeAPI/crystallize-elasticsearch-example-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CrystallizeAPI/crystallize-elasticsearch-example-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrystallizeAPI%2Fcrystallize-elasticsearch-example-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrystallizeAPI%2Fcrystallize-elasticsearch-example-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrystallizeAPI%2Fcrystallize-elasticsearch-example-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrystallizeAPI%2Fcrystallize-elasticsearch-example-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrystallizeAPI","download_url":"https://codeload.github.com/CrystallizeAPI/crystallize-elasticsearch-example-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrystallizeAPI%2Fcrystallize-elasticsearch-example-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32127760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T07:37:52.372Z","status":"ssl_error","status_checked_at":"2026-04-22T07:37:51.635Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T14:12:48.852Z","updated_at":"2026-04-22T08:30:59.680Z","avatar_url":"https://github.com/CrystallizeAPI.png","language":"JavaScript","readme":"# Crystallize ElasticSearch Example (JS)\n\n\u003e An example service for integrating ElasticSearch with Crystallize.\n\n## Getting Started\n\n### Creating an ElasticSearch Instance\n\n#### Locally\n\nFor local development you can set up an ElasticSearch cluster easily via\ndocker-compose.\n\n```sh\ndocker-compose up -d\n```\n\nThis will provide you with an ElasticSearch node available at\n`http://localhost:9200`.\n\nCreate a file named `.env` in the root of this project and place the following\nvariable in order to use your local cluster for indexing and searching.\n\n```\nES_NODE=http://localhost:9200\n```\n\n#### Elastic Cloud\n\nYou can also create a deployment on [Elastic Cloud](https://www.elastic.co). If\nyou are using Elastic Cloud, create a new deployment and add the node, username,\nand password to your `.env` file in the root of this project in order to use it\nfor indexing and searching. The username and password are generated after your\nservice has been deployed.\n\n```\nES_NODE=\u003cyour-elastic-deployment-url\u003e\nES_USER=\u003cyour-elastic-deployment-user\u003e\nES_PASS=\u003cyour-elastic-deployment-pass\u003e\n```\n\n### Running the Server\n\nBeing an example, this project exposes both queries for searching as well as\nmutations for indexing a tenant via GraphQL. You may wish to remove mutations\nfrom a publicly exposed endpoint.\n\nYou can run the server with either `yarn start` for production, or `yarn dev`\nfor local development.\n\nThis will provide you with a playground available at\n`http://localhost:4000/graphql`.\n\n#### Indexing Your Tenant\n\nYou can index your tenant's catalogue by running the `bulkIndex` mutation via\nGraphQL. As an example you can try indexing the `teddy-bear-shop`, or\nalternatively your own tenant.\n\n```graphql\nmutation {\n  bulkIndex(tenant: \"teddy-bear-shop\", language: \"en\") {\n    success\n    message\n    executionTime\n  }\n}\n```\n\n#### Searching Your Catalogue\n\nYou can search your catalogue using the `productVariants` query. You can view\nthe full schema via the GraphQL playground with all the fields you can query,\nsearch and filter. For example:\n\n```graphql\nquery {\n  productVariants(\n    filter: { searchTerm: \"kiwi\" }\n    orderBy: { field: PRICE, direction: DESC }\n  ) {\n    totalCount\n    productVariants {\n      variant {\n        name\n        price\n        stock\n      }\n      product {\n        name\n      }\n    }\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystallizeapi%2Fcrystallize-elasticsearch-example-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystallizeapi%2Fcrystallize-elasticsearch-example-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystallizeapi%2Fcrystallize-elasticsearch-example-js/lists"}