/* -------------------------------------------------------------------
**
** riak_search.proto: Protocol buffers for Riak Search
**
** Copyright (c) 2012 Basho Technologies, Inc.  All Rights Reserved.
**
** This file is provided to you under the Apache License,
** Version 2.0 (the "License"); you may not use this file
** except in compliance with the License.  You may obtain
** a copy of the License at
**
**   http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing,
** software distributed under the License is distributed on an
** "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
** KIND, either express or implied.  See the License for the
** specific language governing permissions and limitations
** under the License.
**
** -------------------------------------------------------------------
*/

/*
** Revision: 1.2
*/

import "riak.proto";

// java package specifiers
option java_package = "com.basho.riak.protobuf";
option java_outer_classname = "RiakSearchPB";

message RpbSearchDoc {
  repeated RpbPair fields = 1;
}

message RpbSearchQueryReq {
  required bytes  q      =  1;  // Query string
  required bytes  index  =  2;  // Index
  optional uint32 rows   =  3;  // Limit rows
  optional uint32 start  =  4;  // Starting offset
  optional bytes  sort   =  5;  // Sort order
  optional bytes  filter =  6;  // Inline fields filtering query
  optional bytes  df     =  7;  // Default field
  optional bytes  op     =  8;  // Default op
  repeated bytes  fl     =  9;  // Return fields limit (for ids only, generally)
  optional bytes  presort = 10; // Presort (key / score)
}

message RpbSearchQueryResp {
  repeated RpbSearchDoc docs      = 1; // Result documents
  optional float        max_score = 2; // Maximum score
  optional uint32       num_found = 3; // Number of results
}
