Skip to content

Instantly share code, notes, and snippets.

@maxpeterson
Last active October 13, 2015 16:38
Show Gist options
  • Select an option

  • Save maxpeterson/4224964 to your computer and use it in GitHub Desktop.

Select an option

Save maxpeterson/4224964 to your computer and use it in GitHub Desktop.
Cloudant CustomSearch for creating a private jamjs.org
exports.repositories = [
{
url: "https://USERNAME:[email protected]/DATABASE",
search: "https://USERNAME:[email protected]/DATABASE/_design/lucene/_search/jam"
},
"http://jamjs.org/repository"
];
{
"indexes": {
"jam": {
"index": "function(doc){
index(\"default\", doc._id);
if(doc.name){
index(\"default\", doc.name, {\"store\": \"yes\"});
}
if(doc.keywords){
index(\"default\", doc.keywords, {\"store\": \"yes\"});
}
if(doc.description){
index(\"default\", doc.description, {\"store\": \"yes\"});
}
}"
}
}
}
@maxpeterson
Copy link
Author

To set up a private http://jamjs.org/ repository on https://cloudant.com/

  1. Sign up for a Cloudant account.
  2. Add a database.
  3. Upload the search document curl -X PUT https://USERNAME:[email protected]/DATABASE/_design/lucene [email protected]
  4. Add the repository urls to your .jamrc

Further info on Cloudant lucen search indexes at https://cloudant.com/for-developers/search/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment