Skip to content

Commit

Permalink
enable with_vector flag in api #50
Browse files Browse the repository at this point in the history
  • Loading branch information
generall committed Jan 30, 2022
1 parent 376c2e0 commit 1a909e6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/redoc/master/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,10 @@
"nullable": true
}
]
},
"with_vector": {
"nullable": true,
"type": "boolean"
}
},
"required": [
Expand Down
4 changes: 4 additions & 0 deletions docs/redoc/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,10 @@
"nullable": true
}
]
},
"with_vector": {
"nullable": true,
"type": "boolean"
}
},
"required": [
Expand Down
4 changes: 4 additions & 0 deletions openapi/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,10 @@
"nullable": true
}
]
},
"with_vector": {
"type": "boolean",
"nullable": true
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions openapi/openapi-merged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,9 @@ components:
anyOf:
- $ref: '#/components/schemas/WithPayloadInterface'
- nullable: true
with_vector:
nullable: true
type: boolean
required:
- ids
type: object
Expand Down
10 changes: 8 additions & 2 deletions src/actix/api/retrieve_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::actix::helpers::process_response;
pub struct PointRequest {
pub ids: Vec<PointIdType>,
pub with_payload: Option<WithPayloadInterface>,
pub with_vector: Option<bool>,
}

async fn do_get_point(
Expand All @@ -37,8 +38,13 @@ async fn do_get_points(
.with_payload
.unwrap_or(WithPayloadInterface::Bool(true));
let with_payload = WithPayload::from(with_payload_interface);
toc.retrieve(collection_name, &request.ids, &with_payload, true)
.await
toc.retrieve(
collection_name,
&request.ids,
&with_payload,
request.with_vector.unwrap_or(false),
)
.await
}

async fn scroll_get_points(
Expand Down

0 comments on commit 1a909e6

Please sign in to comment.