Skip to content

Instantly share code, notes, and snippets.

@arifsetiawan
Created December 19, 2012 09:12
Show Gist options
  • Save arifsetiawan/4335484 to your computer and use it in GitHub Desktop.
Save arifsetiawan/4335484 to your computer and use it in GitHub Desktop.
riak-js search result
// search 'indexes'
{ "docs" : [ { "fields" : { "value" : "Search indexes Riak KV objects as theyre written using a precommit hook. Based on the object?s mime type and the Search schema you?ve set for its bucket, the hook will automatically extract and analyze your data and build indexes from it. The Riak Client API is used to invoke Search queries that return a list of bucket/key pairs matching the query. Currently the PHP, Python, Ruby, and Erlang client libraries support integration with Riak Search." },
"id" : "text-00002",
"index" : "textr",
"props" : { }
},
{ "fields" : { "value" : "When Search is enabled on your Riak cluster, another set of vnodes, equal to the number of KV vnodes, will be started which will be used to handle Search requests. Search is enabled on a per-bucket basis by setting the search property to true. If search is enabled for a bucket, indexes are generated on all objects as they are written to it using the pre-commit hook. Index data stored on Search vnodes is replicated across the cluster using the same general mechanism as Riak KV, but using timestamps rather than vector clocks to increase performance." },
"id" : "text-00004",
"index" : "textr",
"props" : { }
}
],
"maxScore" : "0.500000",
"numFound" : 2,
"start" : 0
}
// search 'distributed'
{ "docs" : [ ],
"maxScore" : "0.0",
"numFound" : 0,
"start" : 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment