{"id":16990400,"url":"https://github.com/amingolmahalle/elasticsearch_example","last_synced_at":"2026-04-10T01:17:01.629Z","repository":{"id":169559905,"uuid":"325868756","full_name":"amingolmahalle/Elasticsearch_Example","owner":"amingolmahalle","description":"Set up Elasticsearch By NEST Library  with ASP.NET Core and Docker","archived":false,"fork":false,"pushed_at":"2021-01-01T18:20:14.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T00:26:59.091Z","etag":null,"topics":["asp-net-core","docker","docker-compose","elasticsearch","kibana"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amingolmahalle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-31T20:27:06.000Z","updated_at":"2023-05-20T20:29:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"753e3910-8939-4256-bc03-fa0cf8888608","html_url":"https://github.com/amingolmahalle/Elasticsearch_Example","commit_stats":null,"previous_names":["amingolmahalle/elasticsearch_example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amingolmahalle%2FElasticsearch_Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amingolmahalle%2FElasticsearch_Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amingolmahalle%2FElasticsearch_Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amingolmahalle%2FElasticsearch_Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amingolmahalle","download_url":"https://codeload.github.com/amingolmahalle/Elasticsearch_Example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244900134,"owners_count":20528638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["asp-net-core","docker","docker-compose","elasticsearch","kibana"],"created_at":"2024-10-14T03:09:54.803Z","updated_at":"2025-12-30T23:53:29.678Z","avatar_url":"https://github.com/amingolmahalle.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elasticsearch_Example\nSet up Elasticsearch By NEST Library version 7.10.1 with ASP.NET Core 3.1 and Docker.\n\nto run and test project,you must do the following steps first.\n\nfirstyou have to create network to watch Elasticsearch and Kibana on Docker by below command:\n\n\u003ccode\u003esudo docker create network esnetwork\u003c/code\u003e\n\n\u003ch3\u003eElasticsearch:\u003c/h3\u003e\n\n\u003ccode\u003edocker run --rm -p 9200:9200 -p 9300:9300 -e \"discovery.type=single-node\" --name elasticsearch --network esnetwork elasticsearch:7.9.3\u003c/code\u003e\n\n\u003ch3\u003eKibana:\u003c/h3\u003e\n\n\u003ccode\u003edocker run --rm -p 5601:5601 --name kibana --network esnetwork kibana:7.9.3\u003c/code\u003e\n\nafter run containers,now We can run and test project.\n\n\u003ch2\u003ebefore runing and testing the project, it is better to talk about Key Concepts of the Elasticsearch\u003c/h2\u003e\n\n\u003ch2\u003eKey Concepts\u003c/h2\u003e\n\u003cp\u003eThe key concepts of Elasticsearch are as follows:\u003c/p\u003e\n\u003ch3\u003eNode\u003c/h3\u003e\n\u003cp\u003eIt refers to a single running instance of Elasticsearch. Single physical and virtual server accommodates multiple nodes depending upon the capabilities of their physical resources like RAM, storage and processing power.\u003c/p\u003e\n\u003ch3\u003eCluster\u003c/h3\u003e\n\u003cp\u003eIt is a collection of one or more nodes. Cluster provides collective indexing and search capabilities across all the nodes for entire data.\u003c/p\u003e\n\u003ch3\u003eIndex\u003c/h3\u003e\n\u003cp\u003eIt is a collection of different type of documents and their properties. Index also uses the concept of shards to improve the performance. For example, a set of document contains data of a social networking application.\u003c/p\u003e\n\u003ch3\u003eDocument\u003c/h3\u003e\n\u003cp\u003eIt is a collection of fields in a specific manner defined in JSON format. Every document belongs to a type and resides inside an index. Every document is associated with a unique identifier called the UID.\u003c/p\u003e\n\u003ch3\u003eShard\u003c/h3\u003e\n\u003cp\u003eIndexes are horizontally subdivided into shards. This means each shard contains all the properties of document but contains less number of JSON objects than index. The horizontal separation makes shard an independent node, which can be store in any node. Primary shard is the original horizontal part of an index and then these primary shards are replicated into replica shards.\u003c/p\u003e\n\u003ch3\u003eReplicas\u003c/h3\u003e\n\u003cp\u003eElasticsearch allows a user to create replicas of their indexes and shards. Replication not only helps in increasing the availability of data in case of failure, but also improves the performance of searching by carrying out a parallel search operation in these replicas.\u003c/p\u003e\n\n\u003ch2\u003eComparison between Elasticsearch and RDBMS\u003c/h2\u003e\n\n\u003cp\u003eIn Elasticsearch, index is similar to tables in RDBMS (Relation Database Management System). Every table is a collection of rows just as every index is a collection of documents in Elasticsearch. \u003c/p\u003e\n\n\u003cp\u003eThe following table gives a direct comparison between these terms.\u003c/p\u003e\n\n\u003ctable class=\"table table-bordered\" style=\"text-align:center;\"\u003e\n\u003ctbody\u003e\u003ctr\u003e\n\u003cth\u003eElasticsearch\u003c/th\u003e\n\u003cth\u003eRDBMS\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCluster\u003c/td\u003e\n\u003ctd\u003eDatabase\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eShard\u003c/td\u003e\n\u003ctd\u003eShard\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eIndex\u003c/td\u003e\n\u003ctd\u003eTable\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eField\u003c/td\u003e\n\u003ctd\u003eColumn\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDocument\u003c/td\u003e\n\u003ctd\u003eRow\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\n\u003cb\u003eto run CreateIndex api, call below url:\u003c/b\u003e\n\nHttpGet --\u003e http://localhost:5000/post/createIndex\n\n\u003cb\u003eto run reIndex api, call below url:\u003c/b\u003e\n\nreIndex means :remove current index then create new index and bind data to new index.\n\nHttpGet --\u003e http://localhost:5000/post/reIndex\n\n\u003cb\u003eto run deleteDocument api, call below url:\u003c/b\u003e\n\nHttpDelete --\u003e http://localhost:5000 /post/deleteDocument/0f8fad5b-d9cb-469f-a165-70867728950e\n\n\u003cb\u003eto run searchDocumnet api, call bellow url:\u003c/b\u003e\n\nHttpPost --\u003e http://localhost:5000/post/searchDocument\n\nbody:{\"query\":\"0c885dd3-7dd9-484b-9b20-3e6552bca144\"}\n\n\u003cb\u003eto run addDocument api, call below url:\u003c/b\u003e\n\nHttpPost --\u003e http://localhost:5000/post/addDocument\n\nbody:\n\u003cpre\u003e{\n\"Title\": \"title00222\",\n\"Slug\":\"slug00222\",\n\"Excerpt\":\"excerpt2222\",\n\"Content\":\"content2222\",\n\"IsPublished\":true, \n\"Categories\":[\n    \"Game\",\n    \"Clothing\",\n    \"Food\",\n    \"Art\"\n],\n\"Comments\":[\n{\n\"Id\":1,\n\"Author\":\"javad barber\",\n\"Email\":\"j.barber@yahoo.com\",\n\"Content\":\"Description about barber Book\"\n},\n{\n\"Id\":3,\n\"Author\":\"mehdi shabani\",\n\"Email\":\"mehdi@outlook.com\",\n\"Content\":\"Description about Fitness Book\"\n}\n]\n}\n\u003c/pre\u003e\n\n\u003cb\u003eto run editDocument api, call below url:\u003c/b\u003e\n\nHttpPut --\u003e http://localhost:5000/post/editDocument/0f8fad5b-d9cb-469f-a165-70867728950e\n\nbody:\n\u003cpre\u003e\n{\n\"Title\": \"title00222\",\n\"Slug\":\"slug00222\",\n\"Excerpt\":\"excerpt2222\",\n\"Content\":\"content2222\",\n\"IsPublished\":true, \n\"Categories\":[\n    \"Game\",\n    \"Clothing\",\n    \"Food\",\n    \"Art\"\n],\n\"Comments\":[\n{\n\"Id\":1,\n\"Author\":\"javad barber\",\n\"Email\":\"j.barber@yahoo.com\",\n\"Content\":\"Description about barber Book\"\n},\n{\n\"Id\":3,\n\"Author\":\"mehdi shabani\",\n\"Email\":\"mehdi@outlook.com\",\n\"Content\":\"Description about Fitness Book\"\n}\n]\n}\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famingolmahalle%2Felasticsearch_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famingolmahalle%2Felasticsearch_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famingolmahalle%2Felasticsearch_example/lists"}