Skip to content

Instantly share code, notes, and snippets.

@jaminben
Created June 29, 2010 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaminben/e641e7bafce7787e17b4 to your computer and use it in GitHub Desktop.
Save jaminben/e641e7bafce7787e17b4 to your computer and use it in GitHub Desktop.
// index function:
function(doc){
if(doc.events) {
var ret = new Document();
ret.add(parseInt(doc.site_id), {"field": "site_id", "type" : "int"});
ret.add(doc.site_id.toString(), {"field": "siteid"});
ret.add(parseInt(doc.site_id), {"field": "siteid1", "type" : "long"});
ret.add(7, {"field": "test_long", "type" : "long"});
ret.add(7, {"field": "test_int", "type" : "int"});
ret.add(7, {"field": "test_string_int"});
ret.add('7', {"field": "test_string"});
return ret;
}else { return null }
}
@jaminben
Copy link
Author

test1/_fti/_design/search/by_content?q=test_int:7
--> No results

test1/_fti/_design/search/by_content?q=test_long:7
--> No results

test1/_fti/_design/search/by_content?q=test_string:7
--> Works

test1/_fti/_design/search/by_content?q=test_string_int:7
--> Works

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