search

package
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_search_proto protoreflect.FileDescriptor

Functions

func NewSearchEndpoints

func NewSearchEndpoints() []*api.Endpoint

func RegisterSearchHandler

func RegisterSearchHandler(s server.Server, hdlr SearchHandler, opts ...server.HandlerOption) error

Types

type CreateIndexRequest

type CreateIndexRequest struct {

	// the name of the index
	Index  string   `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
	Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
	// contains filtered or unexported fields
}

Create a search index by specifying which fields are to be queried

func (*CreateIndexRequest) Descriptor deprecated

func (*CreateIndexRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateIndexRequest.ProtoReflect.Descriptor instead.

func (*CreateIndexRequest) GetFields

func (x *CreateIndexRequest) GetFields() []*Field

func (*CreateIndexRequest) GetIndex

func (x *CreateIndexRequest) GetIndex() string

func (*CreateIndexRequest) ProtoMessage

func (*CreateIndexRequest) ProtoMessage()

func (*CreateIndexRequest) ProtoReflect

func (x *CreateIndexRequest) ProtoReflect() protoreflect.Message

func (*CreateIndexRequest) Reset

func (x *CreateIndexRequest) Reset()

func (*CreateIndexRequest) String

func (x *CreateIndexRequest) String() string

type CreateIndexResponse

type CreateIndexResponse struct {
	// contains filtered or unexported fields
}

func (*CreateIndexResponse) Descriptor deprecated

func (*CreateIndexResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateIndexResponse.ProtoReflect.Descriptor instead.

func (*CreateIndexResponse) ProtoMessage

func (*CreateIndexResponse) ProtoMessage()

func (*CreateIndexResponse) ProtoReflect

func (x *CreateIndexResponse) ProtoReflect() protoreflect.Message

func (*CreateIndexResponse) Reset

func (x *CreateIndexResponse) Reset()

func (*CreateIndexResponse) String

func (x *CreateIndexResponse) String() string

type DeleteIndexRequest

type DeleteIndexRequest struct {

	// The name of the index to delete
	Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
	// contains filtered or unexported fields
}

Delete an index.

func (*DeleteIndexRequest) Descriptor deprecated

func (*DeleteIndexRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteIndexRequest.ProtoReflect.Descriptor instead.

func (*DeleteIndexRequest) GetIndex

func (x *DeleteIndexRequest) GetIndex() string

func (*DeleteIndexRequest) ProtoMessage

func (*DeleteIndexRequest) ProtoMessage()

func (*DeleteIndexRequest) ProtoReflect

func (x *DeleteIndexRequest) ProtoReflect() protoreflect.Message

func (*DeleteIndexRequest) Reset

func (x *DeleteIndexRequest) Reset()

func (*DeleteIndexRequest) String

func (x *DeleteIndexRequest) String() string

type DeleteIndexResponse

type DeleteIndexResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteIndexResponse) Descriptor deprecated

func (*DeleteIndexResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteIndexResponse.ProtoReflect.Descriptor instead.

func (*DeleteIndexResponse) ProtoMessage

func (*DeleteIndexResponse) ProtoMessage()

func (*DeleteIndexResponse) ProtoReflect

func (x *DeleteIndexResponse) ProtoReflect() protoreflect.Message

func (*DeleteIndexResponse) Reset

func (x *DeleteIndexResponse) Reset()

func (*DeleteIndexResponse) String

func (x *DeleteIndexResponse) String() string

type DeleteRequest

type DeleteRequest struct {

	// The ID of the document to delete
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The index the document belongs to
	Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"`
	// contains filtered or unexported fields
}

Delete a document given its ID

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetId

func (x *DeleteRequest) GetId() string

func (*DeleteRequest) GetIndex

func (x *DeleteRequest) GetIndex() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type Document

type Document struct {

	// The ID for this document. If blank, one will be generated
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The JSON contents of the document
	Contents *structpb.Struct `protobuf:"bytes,2,opt,name=contents,proto3" json:"contents,omitempty"`
	// contains filtered or unexported fields
}

func (*Document) Descriptor deprecated

func (*Document) Descriptor() ([]byte, []int)

Deprecated: Use Document.ProtoReflect.Descriptor instead.

func (*Document) GetContents

func (x *Document) GetContents() *structpb.Struct

func (*Document) GetId

func (x *Document) GetId() string

func (*Document) ProtoMessage

func (*Document) ProtoMessage()

func (*Document) ProtoReflect

func (x *Document) ProtoReflect() protoreflect.Message

func (*Document) Reset

func (x *Document) Reset()

func (*Document) String

func (x *Document) String() string

type Field

type Field struct {

	// The name of the field. Use a `.` separator to define nested fields e.g. foo.bar
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The type of the field - string, number
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*Field) Descriptor deprecated

func (*Field) Descriptor() ([]byte, []int)

Deprecated: Use Field.ProtoReflect.Descriptor instead.

func (*Field) GetName

func (x *Field) GetName() string

func (*Field) GetType

func (x *Field) GetType() string

func (*Field) ProtoMessage

func (*Field) ProtoMessage()

func (*Field) ProtoReflect

func (x *Field) ProtoReflect() protoreflect.Message

func (*Field) Reset

func (x *Field) Reset()

func (*Field) String

func (x *Field) String() string

type IndexRequest

type IndexRequest struct {

	// The document to index
	Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
	// The index this document belongs to
	Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"`
	// contains filtered or unexported fields
}

Index a document i.e. insert a document to search for.

func (*IndexRequest) Descriptor deprecated

func (*IndexRequest) Descriptor() ([]byte, []int)

Deprecated: Use IndexRequest.ProtoReflect.Descriptor instead.

func (*IndexRequest) GetDocument

func (x *IndexRequest) GetDocument() *Document

func (*IndexRequest) GetIndex

func (x *IndexRequest) GetIndex() string

func (*IndexRequest) ProtoMessage

func (*IndexRequest) ProtoMessage()

func (*IndexRequest) ProtoReflect

func (x *IndexRequest) ProtoReflect() protoreflect.Message

func (*IndexRequest) Reset

func (x *IndexRequest) Reset()

func (*IndexRequest) String

func (x *IndexRequest) String() string

type IndexResponse

type IndexResponse struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*IndexResponse) Descriptor deprecated

func (*IndexResponse) Descriptor() ([]byte, []int)

Deprecated: Use IndexResponse.ProtoReflect.Descriptor instead.

func (*IndexResponse) GetId

func (x *IndexResponse) GetId() string

func (*IndexResponse) ProtoMessage

func (*IndexResponse) ProtoMessage()

func (*IndexResponse) ProtoReflect

func (x *IndexResponse) ProtoReflect() protoreflect.Message

func (*IndexResponse) Reset

func (x *IndexResponse) Reset()

func (*IndexResponse) String

func (x *IndexResponse) String() string

type SearchRequest

type SearchRequest struct {

	// The index the document belongs to
	Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
	// The query. See docs for query language examples
	Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
	// contains filtered or unexported fields
}

Search for documents in a given in index

func (*SearchRequest) Descriptor deprecated

func (*SearchRequest) Descriptor() ([]byte, []int)

Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.

func (*SearchRequest) GetIndex

func (x *SearchRequest) GetIndex() string

func (*SearchRequest) GetQuery

func (x *SearchRequest) GetQuery() string

func (*SearchRequest) ProtoMessage

func (*SearchRequest) ProtoMessage()

func (*SearchRequest) ProtoReflect

func (x *SearchRequest) ProtoReflect() protoreflect.Message

func (*SearchRequest) Reset

func (x *SearchRequest) Reset()

func (*SearchRequest) String

func (x *SearchRequest) String() string

type SearchResponse

type SearchResponse struct {

	// The matching documents
	Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchResponse) Descriptor deprecated

func (*SearchResponse) Descriptor() ([]byte, []int)

Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.

func (*SearchResponse) GetDocuments

func (x *SearchResponse) GetDocuments() []*Document

func (*SearchResponse) ProtoMessage

func (*SearchResponse) ProtoMessage()

func (*SearchResponse) ProtoReflect

func (x *SearchResponse) ProtoReflect() protoreflect.Message

func (*SearchResponse) Reset

func (x *SearchResponse) Reset()

func (*SearchResponse) String

func (x *SearchResponse) String() string

type SearchService

type SearchService interface {
	Index(ctx context.Context, in *IndexRequest, opts ...client.CallOption) (*IndexResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
	Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error)
	DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...client.CallOption) (*DeleteIndexResponse, error)
}

func NewSearchService

func NewSearchService(name string, c client.Client) SearchService

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL