Search Class
Command used to perform a (Yokozuna) search.
As a convenience, a builder class is provided:
var search = new Search.Builder()
.withIndexName(myIndex)
.withQuery(myQuery)
.withNumRows(10)
.withCallback(myCallback)
.build();
See Search.Builder
For more information on Riak Search (Yokozuna/Solr) see: Using Search
Constructor
Search
-
options
-
callback
Parameters:
-
options
ObjectThe options for this command.
-
indexName
StringSet the index name used for this search.
-
q
StringSet the Solr query string.
-
[maxRows=10]
Number optionalSpecify the maximum number of results to return.
-
[start=0]
String optionalSpecify the starting result of the query.
-
[sortField]
String optionalSort the results on the specified field name.
-
[filterQuery]
String optionalFilters the search by an additional query scoped to inline fields.
-
[defaultField]
String optionalUse the provided field as the default. Overrides the “default_field” setting in the schema file.
-
[defaultOperation]
String optionalSet the default operation. Allowed settings are either “and” or “or”.
-
[returnFields]
String optionalOnly return the provided fields.
-
[presort]
String optionalSorts all of the results. Either "key" or "score".
-
[convertDocuments]
Boolean optionalConvert Solr document values to JS types.
-
-
callback
FunctionThe callback to execute when the comman completes.
-
err
Stringan error message. Will be null if no error.
-
response
Objectthe response from Riak (Solr)
-
numFound
NumberThe number of documents found. -
maxScore
NumberThe max score value. -
docs
ObjectArray of documents returned from Solr.
-
-
data
Objectadditional error data. Will be null if no error.
-
Item Index
Methods
constructPbRequest
()
Object
protected
Returns:
getCallback
()
Function
private
Returns:
getExpectedResponseCode
()
Number
private
Returns:
getPbReqBuilder
()
Object
private
Returns:
getRiakMessage
()
Object
private
Returns:
onError
-
msg
-
data
Parameters:
-
msg
Stringan error message -
data
Objectadditional error data
onRiakError
-
rpbErrorResp
Parameters:
-
rpbErrorResp
Objectthe RpbErrorResp protocol buffer
onSuccess
-
pbResponseMessage
Parameters:
-
pbResponseMessage
Objectthe protocol buffer received from riak