Skip to content

Commit

Permalink
Fixed id format in replace request, updated search response format
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Jan 8, 2025
1 parent 97419cf commit c2fb2fd
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 11 deletions.
27 changes: 21 additions & 6 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ paths:
- _score: the score of the matched document.
- _source: the source data of the matched document.
In addition, if profiling is enabled, the response will include an additional array with profiling information attached.
In addition, if profiling is enabled, the response will include an additional array with profiling information attached. Also, if pagination is enabled, the response will include an additional 'scroll' property with a scroll token to use for pagination
Here is an example search response:
```
Expand Down Expand Up @@ -442,7 +442,8 @@ paths:
name: id
required: true
schema:
type: number
format: int64
type: integer
style: simple
requestBody:
content:
Expand Down Expand Up @@ -666,9 +667,10 @@ components:
$ref: '#/components/schemas/queryFilterAlias2'
type: array
bulkResponse:
additionalProperties: false
description: Success response for bulk search requests
example:
current_line: 0
skipped_lines: 6
error: error
items:
- "{}"
Expand All @@ -686,6 +688,12 @@ components:
error:
description: Error message describing an error if such occurred
type: string
current_line:
description: Number of the row returned in the response
type: integer
skipped_lines:
description: Number of rows skipped in the response
type: integer
deleteDocumentRequest:
description: |
Payload for delete request.
Expand Down Expand Up @@ -1040,6 +1048,9 @@ components:
_index:
description: Name of the document index
type: string
table:
description: Name of the document table (alias of index)
type: string
_id:
description: ID of the document affected by the request operation
format: int64
Expand Down Expand Up @@ -1082,6 +1093,7 @@ components:
gid: 20
took: 0
profile: "{}"
scroll: scroll
warning: "{}"
timed_out: true
aggregations: "{}"
Expand All @@ -1102,6 +1114,9 @@ components:
description: "Profile information about the search execution, if profiling\
\ is enabled"
type: object
scroll:
description: Scroll token to be used fo pagination
type: string
warning:
additionalProperties: false
description: Warnings encountered during the search operation
Expand Down Expand Up @@ -1151,13 +1166,13 @@ components:
sqlObjResponse:
type: object
sqlResponse:
anyOf:
- $ref: '#/components/schemas/sqlRawResponse'
- $ref: '#/components/schemas/sqlObjResponse'
description: List of responses from executed SQL queries
example:
- total: 0
error: null
oneOf:
- $ref: '#/components/schemas/sqlRawResponse'
- $ref: '#/components/schemas/sqlObjResponse'
updateDocumentRequest:
description: Payload for updating a document or multiple documents in an index
properties:
Expand Down
4 changes: 2 additions & 2 deletions api_index.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api_search.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/IndexAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ import (

func main() {
index := "index_example" // string | Name of the percolate index
id := float32(8.14) // float32 | Id of the document to replace
id := int64(789) // int64 | Id of the document to replace
replaceDocumentRequest := *openapiclient.NewReplaceDocumentRequest(map[string]interface{}(123)) // ReplaceDocumentRequest |

configuration := openapiclient.NewConfiguration()
Expand All @@ -255,7 +255,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**index** | **string** | Name of the percolate index |
**id** | **float32** | Id of the document to replace |
**id** | **int64** | Id of the document to replace |

### Other Parameters

Expand Down
26 changes: 26 additions & 0 deletions docs/SearchResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Name | Type | Description | Notes
**Aggregations** | Pointer to **map[string]interface{}** | Aggregated search results grouped by the specified criteria | [optional]
**Hits** | Pointer to [**SearchResponseHits**](SearchResponseHits.md) | | [optional]
**Profile** | Pointer to **map[string]interface{}** | Profile information about the search execution, if profiling is enabled | [optional]
**Scroll** | Pointer to **string** | Scroll token to be used fo pagination | [optional]
**Warning** | Pointer to **map[string]interface{}** | Warnings encountered during the search operation | [optional]

## Methods
Expand Down Expand Up @@ -155,6 +156,31 @@ SetProfile sets Profile field to given value.

HasProfile returns a boolean if a field has been set.

### GetScroll

`func (o *SearchResponse) GetScroll() string`

GetScroll returns the Scroll field if non-nil, zero value otherwise.

### GetScrollOk

`func (o *SearchResponse) GetScrollOk() (*string, bool)`

GetScrollOk returns a tuple with the Scroll field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetScroll

`func (o *SearchResponse) SetScroll(v string)`

SetScroll sets Scroll field to given value.

### HasScroll

`func (o *SearchResponse) HasScroll() bool`

HasScroll returns a boolean if a field has been set.

### GetWarning

`func (o *SearchResponse) GetWarning() map[string]interface{}`
Expand Down
37 changes: 37 additions & 0 deletions model_search_response.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c2fb2fd

Please sign in to comment.