Package: kinto-algolia
kinto-algoliaforwards the records to Algolia and provides a/searchendpoint to query the indexed data.Installpip install kinto-algoliaSetupIn theKintosettings:kinto.includes=kinto_algoliakinto.algolia.application_id=YourApplicationIDkinto.algolia.api_key=YourAPIKey# List of buckets/collections to show:kinto.algolia.resources=/buckets/chefclub-v2/buckets/chefclub/collections/recipesBy default, indices names are prefixed withkinto-. You change this with:kinto.algolia.index_prefix=myprefixUsageCreate a new record:$ echo '{"data":
    {"id": "1008855320",
     "last_modified": 1523349594783,
     "title": "kinto",
     "description": "A database for the web",
     "_geoloc": {"lng": -73.778925, "lat": 40.639751}}' | \
    http POST http://localhost:8888/v1/buckets/example/collections/notes/records \
        --auth token:alice-tokenIt should now be possible to search for it using theAlgolia API.For example, using a quick querystring search:$ http "http://localhost:8888/v1/buckets/example/collections/notes/search?query=kinto+database" \
    --auth token:alice-tokenOr an advanced search using request body:$ echo '{"insideBoundingBox": "46.650828100116044,7.123046875,45.17210966999772,1.009765625"}' | \
    http POST http://localhost:8888/v1/buckets/example/collections/notes/search \
        --auth token:alice-tokenHTTP/1.1200OKAccess-Control-Expose-Headers:Retry-After, Content-Length, Alert, BackoffContent-Length:333Content-Type:application/json; charset=UTF-8Date:Wed, 20 Jan 2016 12:02:05 GMTServer:waitress{"hits":[{"_geoloc":{"lat":40.639751,"lng":-73.778925},"_highlightResult":{"title":{"matchLevel":"none","matchedWords":[],"value":"Kinto"}},"last_modified":1523349594783,"title":"Kinto","description":"A database for the web","objectID":"1008855320"}],"hitsPerPage":1000,"nbHits":1,"nbPages":1,"page":0,"params":"insideBoundingBox=42.124710287101955%2C9.335632324218752%2C41.47360232634395%2C14.403076171875002&hitsPerPage=10000&query=","processingTimeMS":2,"query":""}Custom index settingsBy default, Algolia infers the data types from the indexed records.But it’s possible to define the index mappings (ie. schema) from the collection metadata,
in thealgolia:settingsproperty:$echo'{
  "attributesToIndex": ["title", "description"]
}'|httpPATCH"http://localhost:8888/v1/buckets/blog/collections/builds"\--authtoken:admin-token--verboseRefer toAlgolia official documentationfor more information about settings.Running the tests$ make testsChangelog1.1.0 (2019-04-26)Upgrade to algoliasearch 2.01.0.0 (2019-02-08)Add support for collections whitelist. (#6)0.2.0 (2018-07-18)Bug fixesUpdate algolia settings.0.1.1 (2018-06-06)Bug fixesFix reindex command.0.1.0 (2018-04-12)New featuresFlush indices when server is flushedPerform insertions and deletion in bulk for better efficiencyAdd heartbeatDelete indices when buckets and collections are deletedSupport quick search from querystringSupport defining mapping from thealgolia:settingsproperty in the collection metadataBug fixesOnly index records if the storage transaction is committedDo not allow to search if no read permission on collection or bucketFix empty results response when plugin was enabled after collection creationInternal changesCreate index when collection is created