{"id":18317932,"url":"https://github.com/idiocc/elastic","last_synced_at":"2025-10-23T13:44:29.529Z","repository":{"id":57117466,"uuid":"157597445","full_name":"idiocc/elastic","owner":"idiocc","description":"A Library To Manage Operations On ElasticSearch.","archived":false,"fork":false,"pushed_at":"2018-11-15T16:37:43.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-17T03:03:36.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://idio.cc","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/idiocc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-11-14T19:07:44.000Z","updated_at":"2018-11-15T16:37:45.000Z","dependencies_parsed_at":"2022-08-23T04:40:38.057Z","dependency_job_id":null,"html_url":"https://github.com/idiocc/elastic","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Felastic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Felastic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Felastic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Felastic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idiocc","download_url":"https://codeload.github.com/idiocc/elastic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054218,"owners_count":21039951,"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":[],"created_at":"2024-11-05T18:07:55.799Z","updated_at":"2025-10-23T13:44:24.492Z","avatar_url":"https://github.com/idiocc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @idio/elastic\n\n[![npm version](https://badge.fury.io/js/%40idio%2Felastic.svg)](https://npmjs.org/package/@idio/elastic)\n\n`@idio/elastic` Is A Library To Manage Operations On ElasticSearch.\n\n```sh\nyarn add -E @idio/elastic\n```\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [API](#api)\n- [`async search(client: Client, searchParams: SearchParams, queryParams?: Object): Hits[]`](#async-searchclient-clientsearchparams-searchparamsqueryparams-object-hits)\n  * [`Hit`](#type-hit)\n- [Copyright](#copyright)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/0.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## API\n\nThe package is available by importing its components functions:\n\n```js\nimport { search } from '@idio/elastic'\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/1.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## `async search(`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`client: Client,`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`searchParams: SearchParams,`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`queryParams?: Object,`\u003cbr/\u003e`): Hits[]`\n\nThe wrapper around search to make a query based on a data object. Returns an empty array no no hits are found.\n\n`import('elasticsearch').Client` __\u003ca name=\"type-client\"\u003e`Client`\u003c/a\u003e__\n\n`import('elasticsearch').SearchParams` __\u003ca name=\"type-searchparams\"\u003e`SearchParams`\u003c/a\u003e__\n\n__\u003ca name=\"type-hit\"\u003e`Hit`\u003c/a\u003e__\n\n|      Name       |     Type      |               Description                |\n| --------------- | ------------- | ---------------------------------------- |\n| ___id*__        | _string_      | `DQn4JC6q5zZQsgv5KNhiWlgd`               |\n| ___index*__     | _string_      | `idio-example`                           |\n| ___score*__     | _number_      | `1`                                      |\n| ___source*__    | _*_           | `Object {name: \"example\", user: \"idio\"}` |\n| ___type*__      | _string_      | `doc`                                    |\n| _version        | _number_      |                                          |\n| _explanation    | _Explanation_ |                                          |\n| fields          | _*_           |                                          |\n| highlight       | _*_           |                                          |\n| inner_hits      | _*_           |                                          |\n| matched_queries | _string[]_    |                                          |\n| sort            | _string[]_    |                                          |\n\n```js\nconst INDEX = 'idio-example'\n\n;(async () =\u003e {\n  // 1. Create a record in ElasticSearch for the example.\n  const { id, client } = await getClient()\n  const res = await search(client, {\n    index: INDEX,\n    type: 'doc',\n  }, { _id: id })\n  console.log(res)\n})()\n```\n```\n[ { _index: 'idio-example',\n    _type: 'doc',\n    _id: '7Tn79YCXy9lKoxQi7l9k0SHq',\n    _score: 1,\n    _source: \n     { name: 'example',\n       user: 'idio',\n       date: '2018-11-15T15:57:52.031Z' } } ]\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/2.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Copyright\n\n(c) [Idio][1] 2018\n\n[1]: https://idio.cc\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/-1.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiocc%2Felastic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidiocc%2Felastic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiocc%2Felastic/lists"}