Skip to content

Commit

Permalink
Reduce size of search index when serialized (#6973)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Dec 4, 2024
1 parent 810c22a commit 73a2d41
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/canisters/community/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Introduce community `MembersMap` in prep for move to stable memory ([#6966](https://github.com/open-chat-labs/open-chat/pull/6966))
- Migrate community members to stable memory ([#6967](https://github.com/open-chat-labs/open-chat/pull/6967))
- Check bot + user permissions when issuing JWT ([#6970](https://github.com/open-chat-labs/open-chat/pull/6970))
- Reduce size of search index when serialized ([#6973](https://github.com/open-chat-labs/open-chat/pull/6973))

### Removed

Expand Down
1 change: 1 addition & 0 deletions backend/canisters/group/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Re-run member migration to stable memory using reduced size format ([#6965](https://github.com/open-chat-labs/open-chat/pull/6965))
- Check bot + user permissions when issuing JWT ([#6970](https://github.com/open-chat-labs/open-chat/pull/6970))
- Reduce size of search index when serialized ([#6973](https://github.com/open-chat-labs/open-chat/pull/6973))

## [[2.0.1491](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1491-group)] - 2024-12-03

Expand Down
1 change: 1 addition & 0 deletions backend/canisters/user/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Remove chat event updates after 31 days ([#6916](https://github.com/open-chat-labs/open-chat/pull/6916))
- Make `StableMemoryMap` use strongly typed keys ([#6937](https://github.com/open-chat-labs/open-chat/pull/6937))
- Disallow sending prize messages to threads ([#6960](https://github.com/open-chat-labs/open-chat/pull/6960))
- Reduce size of search index when serialized ([#6973](https://github.com/open-chat-labs/open-chat/pull/6973))

### Removed

Expand Down
5 changes: 5 additions & 0 deletions backend/libraries/search/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ pub struct Query {

#[derive(Serialize, Deserialize)]
pub struct Token {
#[serde(rename = "v", alias = "value")]
pub value: String,
#[serde(rename = "l", alias = "value_lower")]
pub value_lower: String,
}

Expand All @@ -31,7 +33,9 @@ impl Query {

#[derive(Serialize, Deserialize)]
pub struct Field {
#[serde(rename = "t", alias = "tokens")]
tokens: Vec<Token>,
#[serde(rename = "w", alias = "weight")]
weight: f32,
}

Expand All @@ -46,6 +50,7 @@ impl Field {

#[derive(Serialize, Deserialize, Default)]
pub struct Document {
#[serde(rename = "f", alias = "fields")]
fields: Vec<Field>,
}

Expand Down

0 comments on commit 73a2d41

Please sign in to comment.