{"id":18711874,"url":"https://github.com/arpit2438735/nativescript-algolia","last_synced_at":"2025-04-11T07:57:20.211Z","repository":{"id":52541029,"uuid":"92024063","full_name":"arpit2438735/nativescript-algolia","owner":"arpit2438735","description":"Nativescript library for algolia search","archived":false,"fork":false,"pushed_at":"2021-04-26T18:33:40.000Z","size":2387,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-13T05:03:01.627Z","etag":null,"topics":["algolia","nativescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arpit2438735.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-22T07:25:35.000Z","updated_at":"2023-11-07T12:45:38.000Z","dependencies_parsed_at":"2022-09-04T10:40:42.277Z","dependency_job_id":null,"html_url":"https://github.com/arpit2438735/nativescript-algolia","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpit2438735%2Fnativescript-algolia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpit2438735%2Fnativescript-algolia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpit2438735%2Fnativescript-algolia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpit2438735%2Fnativescript-algolia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arpit2438735","download_url":"https://codeload.github.com/arpit2438735/nativescript-algolia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224449096,"owners_count":17313187,"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":["algolia","nativescript"],"created_at":"2024-11-07T12:40:42.789Z","updated_at":"2024-11-14T14:06:28.271Z","avatar_url":"https://github.com/arpit2438735.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Community Integrations"],"sub_categories":[],"readme":"## This plugin is now maintained under the NativeScript Community.\n\nhttps://github.com/nativescript-community/algolia\n\n# NativeScript-Algolia\n\n[![Build Status][build-status]][build-url]\n\n[build-status]:https://travis-ci.org/arpit2438735/nativescript-algolia.svg?branch=master\n[build-url]:https://travis-ci.org/arpit2438735/nativescript-algolia\n\n[NativeScript](http://nativescript.org) plugin for [Algolia](http://algolia.com/ \"Algolia\") search.\n\nThis plugin is designed to mirror, as closely as possible, the structure of [Algolia’s JavaScript](https://github.com/algolia/algoliasearch-client-javascript/) client. You don't have to change or add any extra logic for existing applications, it will work for NativeScript.\n\n## License\nThis plugin is licensed under the MIT license by Arpit Srivastava\n\n## Installation\nTo install, type\n\n```\ntns plugin add nativescript-algolia\n```\n\n## Table of Contents\n\n\n1. **[Install](#install)**\n\n    * [NativeScript](#nativescript)\n\n1. **[Quick Start](#quick-start)**\n\n    * [Initialize the client](#initialize-the-client)\n    * [Push data](#push-data)\n    * [Search](#search)\n    * [Configure](#configure)\n    \n# Getting Started\n\n\n\n## Install\n\n#### NativeScript\n\n```sh\ntns plugin add nativescript-algolia\n```\n\n## Quick Start\n\nIn 30 seconds, this quick start tutorial will show you how to index and search objects.\n\n### Initialize the client\n\nYou first need to initialize the client. For that, you will need your **Application ID** and **API Key**.\nYou can find both of them on [your Algolia account](https://www.algolia.com/api-keys).\n\n```js\nimport {Algolia} from \"nativescript-algolia\";\nvar client = new Algolia('applicationID', 'apiKey');\nvar index = client.initIndex('contacts');\n```\n\n### Push data\n\nWithout any prior configuration, you can start indexing [500 contacts](https://github.com/algolia/algoliasearch-client-csharp/blob/master/contacts.json) in the `contacts` index using the following code:\n\n```js\nvar index = client.initIndex('contacts');\nvar contactsJSON = require('./contacts.json');\n\nindex.addObjects(contactsJSON, function(content, err) {\n  if (err) {\n    console.error(err);\n  }\n});\n```\n\n### Search\n\nWith these tasks complete, you can now search for contacts by querying fields such as firstname, lastname, company and more. As Algolia is typo tolerant, common misspellings can be handled with ease:\n\n```js\n// firstname\nindex.search('jimmie', function(content, err) {\n  console.log(content.hits);\n});\n\n// firstname with typo\nindex.search('jimie', function(content, err) {\n  console.log(content.hits);\n});\n\n// a company\nindex.search('california paint', function(content, err) {\n  console.log(content.hits);\n});\n\n// a firstname \u0026 company\nindex.search('jimmie paint', function(content, err) {\n  console.log(content.hits);\n});\n```\n### Configure\n\nSettings can be customized to tune the search behavior. For example, you can add a custom sort by number of followers to the already great built-in relevance:\n\n```js\nindex.setSettings({\n  'customRanking': ['desc(followers)']\n}, function(err, content) {\n  console.log(content);\n});\n```\n\nYou can also configure the list of attributes you want to index by order of importance (ex: firstname = most important):\n\n**Note:** Since the engine is designed to suggest results as you type, you'll generally search by prefix.\nIn this case the order of attributes is very important to decide which hit is the best:\n\n```js\nindex.setSettings({\n  'searchableAttributes': [\n    'lastname',\n    'firstname',\n    'company',\n    'email',\n    'city',\n    'address'\n  ]\n}, function(content, err) {\n  console.log(content);\n});\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farpit2438735%2Fnativescript-algolia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farpit2438735%2Fnativescript-algolia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farpit2438735%2Fnativescript-algolia/lists"}