Protocol Documentation

Table of Contents

search/search.proto

Top

ClassicalQuery

任意のLucene queryで検索を実行する際に利用するリクエスト。

FieldTypeLabelDescription
query string

Luceneのクエリー

columnsToBeExtracted string repeated

抽出するカラム名のリスト。

numOfPage int32

ページあたりのレコード数。任意。デフォルトは20。

nextFor LastRecord

ページングで利用するための現在保持している結果セットの最終レコード情報。 指定すれば、この最終レコードよりも低いスコアの結果セットを取得できる。 任意。

ComplexSearchRequest

複合検索条件のリクエスト。

全ての検索条件は「AND」で結合される。

FieldTypeLabelDescription
phraseTargetColumn string

phraseにマッチさせるカラム名。

phrase string

形態素解析されるフレーズ。

termTargetColumn string

termにマッチさせるカラム名。

term string

形態素解析されない語句。

intValueTargetColumn string

intValueにマッチさせるカラム名

intValue int32

32ビット整数値。

longValueTargetColumn string

longValueにマッチさせるカラム名。

longValue int64

64ビット整数値。

floatValueTargetColumn string

floatValueにマッチさせるカラム名。

floatValue float

32ビット浮動小数点数。

doubleValueTargetColumn string

doubleValueにマッチさせるカラム名。

doubleValue double

64ビット浮動小数点数。

columnsToBeExtracted string repeated

抽出するカラム名のリスト。

numOfPage int32

ページあたりのレコード数。任意。デフォルトは20。

nextFor LastRecord

ページングで利用するための現在保持している結果セットの最終レコード情報。 指定すれば、この最終レコードよりも低いスコアの結果セットを取得できる。 任意。

LastRecord

現在の結果セットが保持している最終レコードの情報。

FieldTypeLabelDescription
digest string

レコード情報を表すダイジェスト。 同一クエリーの結果セット中でユニークな値。

MultipleSearchRequest

複数の検索条件によって検索を要求する際に利用する型。

FieldTypeLabelDescription
requests MultipleSearchRequestEntry repeated

MultipleSearchRequestEntry

複数の検索条件によって検索を要求する際の要素型。

FieldTypeLabelDescription
requestId int32

クライアントで発行する任意のID。

request ComplexSearchRequest

複合検索条件リクエスト。

MultipleSearchResponse

複数検索条件の応答型。

どの検索条件に対する結果セットであるかrequestIdで識別する。

複数検索条件で検索した時は、ストリームで返される。

FieldTypeLabelDescription
requestId int32

searchResponse SearchResponse

PhraseSearchRequest

フレーズ検索のリクエスト。

FieldTypeLabelDescription
phrase string

形態素解析されるフレーズ。LuceneのQuery言語が利用可能。

columnName string

デフォルトのカラム名。

columnsToBeExtracted string repeated

抽出するカラム名のリスト。

numOfPage int32

ページあたりのレコード数。任意。デフォルトは20。

nextFor LastRecord

ページングで利用するための現在保持している結果セットの最終レコード情報。 指定すれば、この最終レコードよりも低いスコアの結果セットを取得できる。 任意。

PluralPageRequest

複数ページをストリームで一括要求する際に利用されるリクエスト。

FieldTypeLabelDescription
pages int32

ページ数

request ComplexSearchRequest

Record

結果セットの1行を表すレコード。

FieldTypeLabelDescription
entry Record.EntryEntry repeated

カラム名がキーで、その保存された値がバリューのマップ。

digest string

結果セット中のレコードを表す一意な識別子。

Record.EntryEntry

FieldTypeLabelDescription
key string

value string

SearchResponse

検索結果。

FieldTypeLabelDescription
total int32

ヒットしたレコードの総数。

results Record repeated

レコードのリスト。0件の場合は空のリスト。

TermSearchRequest

形態素解析しない語句で検索するリクエスト。

FieldTypeLabelDescription
term string

語句。形態素解析されず、この値と完全に一致するカラムをもつレコードを検索対象とする。

columnName string

カラム名。

columnsToBeExtracted string repeated

抽出するカラム名のリスト。

numOfPage int32

ページあたりのレコード数。任意。デフォルトは20。

nextFor LastRecord

ページングで利用するための現在保持している結果セットの最終レコード情報。 指定すれば、この最終レコードよりも低いスコアの結果セットを取得できる。 任意。

SearchService

検索サービス。

Method NameRequest TypeResponse TypeDescription
searchByPhrase PhraseSearchRequest SearchResponse

フレーズ検索を実行する。

searchByClassicalQuery ClassicalQuery SearchResponse

Lucene Queryによる検索を実行する。

searchByTerm TermSearchRequest SearchResponse

形態素解析されない語句による検索を実行する。

searchByComplexCondition ComplexSearchRequest SearchResponse

複合条件による検索を実行する。

StreamSearchService

ストリームで応答する検索サービス。

Method NameRequest TypeResponse TypeDescription
searchByConditions MultipleSearchRequest MultipleSearchResponse stream

複数条件をまとめてリクエストし、結果をストリームで返す。

searchByConditionsPluralPages PluralPageRequest SearchResponse stream

指定された検索条件で検索し、各ページの検索結果を順次ストリームで返す。

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)