Skip to content

Commit

Permalink
bugfix: make group_tag_set work and make description optional
Browse files Browse the repository at this point in the history
  • Loading branch information
densumesh committed Apr 9, 2024
1 parent 7aec19c commit 49be9f2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@
"args": [],
"cwd": "${workspaceFolder}/server"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'ingestion-microservice'",
"cargo": {
"args": [
"build",
"--manifest-path=./server/Cargo.toml",
"--bin=ingestion-microservice"
]
},
"args": [],
"cwd": "${workspaceFolder}/server"
},
{
"type": "lldb",
"request": "launch",
Expand Down
1 change: 0 additions & 1 deletion convenience.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ reset_script_redis() {

start_local_services() {
echo "Starting local services..."
COMPOSE_PROFILE=dev docker compose up
docker compose up -d db
docker compose up -d redis
docker compose up -d qdrant-database
Expand Down
4 changes: 2 additions & 2 deletions server/src/data/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ pub struct ChunkGroup {
impl ChunkGroup {
pub fn from_details(
name: String,
description: String,
description: Option<String>,
dataset_id: uuid::Uuid,
tracking_id: Option<String>,
metadata: Option<serde_json::Value>,
Expand All @@ -616,7 +616,7 @@ impl ChunkGroup {
ChunkGroup {
id: uuid::Uuid::new_v4(),
name,
description,
description: description.unwrap_or_default(),
dataset_id,
created_at: chrono::Utc::now().naive_local(),
updated_at: chrono::Utc::now().naive_local(),
Expand Down
2 changes: 1 addition & 1 deletion server/src/handlers/chunk_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ impl FieldCondition {
));
}

if self.field.starts_with("group_tag_set.") {
if self.field == "group_tag_set" {
return Ok(Some(
get_group_tag_set_filter_condition(&self, dataset_id, pool)
.await?
Expand Down
6 changes: 2 additions & 4 deletions server/src/handlers/group_handler.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use super::{
auth_handler::{AdminOnly, LoggedUser},
chunk_handler::{
parse_query, ChunkFilter, ScoreChunkDTO, SearchChunkData,
},
chunk_handler::{parse_query, ChunkFilter, ScoreChunkDTO, SearchChunkData},
};
use crate::{
data::models::{
Expand Down Expand Up @@ -58,7 +56,7 @@ pub struct CreateChunkGroupData {
/// Name to assign to the chunk_group. Does not need to be unique.
pub name: String,
/// Description to assign to the chunk_group. Convenience field for you to avoid having to remember what the group is for.
pub description: String,
pub description: Option<String>,
/// Optional tracking id to assign to the chunk_group. This is a unique identifier for the chunk_group.
pub tracking_id: Option<String>,
/// Optional metadata to assign to the chunk_group. This is a JSON object that can store any additional information you want to associate with the chunks inside of the chunk_group.
Expand Down
2 changes: 1 addition & 1 deletion server/src/operators/file_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ pub async fn create_chunks_with_handler(

let chunk_group = ChunkGroup::from_details(
name.clone(),
converted_description,
Some(converted_description),
dataset_org_plan_sub.dataset.id,
None,
None,
Expand Down

0 comments on commit 49be9f2

Please sign in to comment.