add createindex for symmetry

This commit is contained in:
Asim Aslam
2022-01-26 19:11:51 +00:00
parent ceb6dd4198
commit 6321db94cf
3 changed files with 16 additions and 7 deletions

View File

@@ -107,7 +107,7 @@ func (s *Search) CreateIndex(ctx context.Context, request *pb.CreateIndexRequest
if !isValidIndexName(request.Index) {
return errors.BadRequest(method, "Index name should contain only alphanumerics and hyphens")
}
req := openapi.CreateRequest{
req := openapi.IndicesCreateRequest{
Index: indexName(tnt, request.Index),
Body: nil, // TODO populate with fields and their types
}
@@ -156,7 +156,7 @@ func (s *Search) Index(ctx context.Context, request *pb.IndexRequest, response *
if err != nil {
return errors.BadRequest(method, "Error processing document")
}
req := openapi.IndexRequest{
req := openapi.CreateRequest{
Index: indexName(tnt, request.Index),
DocumentID: request.Document.Id,
Body: bytes.NewBuffer(b),