{"id":15725029,"url":"https://github.com/ecto/lunr","last_synced_at":"2026-02-01T02:01:21.666Z","repository":{"id":138995796,"uuid":"3370443","full_name":"ecto/lunr","owner":"ecto","description":"A RESTful full-text indexer, searcher, and recommendation engine","archived":false,"fork":false,"pushed_at":"2012-07-30T23:07:57.000Z","size":111,"stargazers_count":4,"open_issues_count":6,"forks_count":0,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-06-15T13:06:21.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ecto.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}},"created_at":"2012-02-06T20:04:50.000Z","updated_at":"2014-01-10T23:23:15.000Z","dependencies_parsed_at":"2023-03-11T11:55:43.931Z","dependency_job_id":null,"html_url":"https://github.com/ecto/lunr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ecto/lunr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Flunr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Flunr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Flunr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Flunr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecto","download_url":"https://codeload.github.com/ecto/lunr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Flunr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28964401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T01:25:30.373Z","status":"online","status_checked_at":"2026-02-01T02:00:08.102Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-10-03T22:18:58.792Z","updated_at":"2026-02-01T02:01:21.646Z","avatar_url":"https://github.com/ecto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Lunr\n\nA RESTful full-text indexer, searcher, and recommendation engine.\n\n![lunr](http://www.panoramas.dk/moon/hasselblad.jpg)\n\n##Install\n\n    npm install lunr -g\n\n##Start\n\n    npm explore lunr\n    cp config-default.json config.json\n    lunrd start\n\n##Configuration\n\nAll configuration is stored in `config.json`. This is the default configuration:\n\n````json\n{\n  \"port\": 6969,    // accept REST requests on this port\n  \"cache\": false,  // enable Redis caching of GET requests?\n  \"ttl\": null,     // cache TTL in milliseconds [default 60000]\n  \"cluster\": true, // spawn up a server worker for each CPU?\n  \"queue\": false,  // use Redis as a FIFO queue for PUT commands?\n  \"mongo\": {\n    \"host\": \"localhost\",\n    \"port\": 27017,\n    \"database\": \"test\"\n  },\n  \"redis\": {\n    \"host\": \"localhost\",\n    \"post\": 6379\n  }\n}\n````\n\n##How it works\n\nWhen a PUT command is issued against `lunrd`, it is put into a FIFO queue (stored in Redis).\nThis allows Lunr nodes to be load balanced. Each will process keys as it is able to,\nresponding to other commands first (GETs and DELETEs take precedence over PUTs).\n\nEvery piece of content PUT into Lunr will be stemmed and subsequestly indexed.\nLunr will store all documents in Mongo with the following schema:\n\n````json\n{\n  \"_id\": \"myID\",\n  \"t\": \"My Title\",\n  \"c\": \"blah blah blah\",\n  \"ts\": [ \"title\" ],\n  \"cs\": [ \"blah\", \"blah\", \"blah\" ]\n}\n````\n\nIt will then index the terms in a separate collection:\n\n````json\n{\n  \"_id\": \"blah\",\n  \"e\": [\n    {\n      \"_id\": \"myID\",\n      \"count\": 3\n    }\n  ]\n}\n````\n\nIf the `cache` config variable is set to `true`, GET requests will be cached to Redis -\neither for `ttl` milliseconds or 5 minutes.\n\n##API\n\n####GET /:id\n\nGrab the full document from the index.\n\n    curl http://localhost:6969/myID\n\n####PUT /\n\nInsert a document into the index.\n\n    curl -i -X PUT \\\n    -d '{\"_id\": \"myID\", \"title\": \"my title\", \"content\": \"blah blah blah\"}' \\\n    http://localhost:6969/\n\n####DELETE /:id\n\nUnindex a document.\n\n    curl -i -X DELETE http://localhost:6969/myID\n\n####GET /search/:query\n\nRun a lexical similarity query against the index. `:query` must be URL encoded.\n\n    curl http://localhost:6969/search/hello%20world\n\n####GET /similar/:id\n\nRun a similarity query against the index by ID.\n\n    curl http://localhost:6969/similary/myID\n\n##Node convenience wrapper client\n\n    npm install lunr\n\n\n````javascript\nvar lunr = require('lunr');\n\nvar client = new lunr({\n  host: 'localhost',\n  port: 6969\n});\n\nclient.get('myID', console.log);\nclient.put(doc, console.log);\nclient.del('myID', console.log);\nclient.search('blah blah', console.log);\nclient.similar('myID', console.log);\n````\n\n##License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecto%2Flunr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecto%2Flunr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecto%2Flunr/lists"}