Skip to content

Commit

Permalink
Merge pull request #134 from mongodb-developer/sn-work
Browse files Browse the repository at this point in the history
Similarity Vector + index update
  • Loading branch information
snarvaez authored Apr 16, 2024
2 parents 2472fdd + 8cabec6 commit 53de2fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions deployment/game_database/indexes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
db.recordings.createIndex({ "DateTime": 1 });
db.players.createIndex({ "location":1, "Nickname": 1});

db.recordings.createIndex({ "DateTime": 1 });
db.recordings.createIndex({ "location":1, "Event._id":1, "Player.Nickname": 1});
db.recordings.createIndex({ "Player.Nickname": 1,"Event._id": 1 });
db.recordings.createIndex({ "Player.Nickname": 1,"Event._id": 1 });
db.recordings.createIndex({ "location":1, "Event._id":1, "SessionStatisticsPlain.Score":-1, "Player.Nickname": 1}, {name:"ix_event_leaderboard"});
2 changes: 1 addition & 1 deletion deployment/game_database/vector_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "filter"
},
{
"numDimensions": 1186,
"numDimensions": 598,
"path": "similarity_vector",
"similarity": "euclidean",
"type": "vector"
Expand Down
4 changes: 2 additions & 2 deletions rest_service/Controllers/RecordingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ public async Task<IActionResult> PostRecording([FromBody] RecordingRequest recor

newRecording.SimilarityVector = CalculateSimilarityVector(
new List<double[]>() {
newRecording.StatsVector,
newRecording.SpeedVector,
newRecording.AccelVector });
newRecording.StatsVector
});

} catch (Exception) {
// Favor persisting Recording over setting vectors
Expand Down

0 comments on commit 53de2fa

Please sign in to comment.