Skip to content

Conversation

@jordan-smith721
Copy link
Collaborator

Adds UI for vector search and adjusts the backends slightly so search results can show on the UI

jordan-smith721 and others added 4 commits November 5, 2025 11:44
- Replace List.of() with Arrays.asList() to handle null values in MongoDB aggregation pipeline
- Add safe type conversion for year field to handle dirty data (e.g., '1994è1998')
- Improve error handling with specific catch blocks for IOException and InterruptedException
- Add validation for Voyage AI API response structure
- Remove debug logging statements
- Add missing import for voyage_ai_available function
- Add conditional projection to handle non-integer year values (e.g., '1994è1998')
- Return None for invalid year data instead of causing validation errors
Copy link
Collaborator

@dacharyc dacharyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a high level, this looks fine. I only tried it with the Java backend - I didn't run the Python backend - LMK if you'd like me to test it with Python, too.

I did spot a couple of things with Java that I'd love to see us handle. Presumably it's out of scope of MVP at this point given current timeframe, but could we capture these in a doc for future improvements?

}
}

/**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frontend doesn't seem to be handling a case gracefully where the backend is missing the Voyage API key - at least, for Java. Didn't try it with Python. If I omit the Voyage API key from my env file, I don't get any feedback during startup, but when I try to use Vector Search, I see this in the console:

2025-11-06T09:53:28.258-05:00 ERROR 40074 --- [sample-app-java-mflix] [nio-3001-exec-6] c.m.s.exception.GlobalExceptionHandler   : Validation error: Vector search unavailable: VOYAGE_API_KEY not configured. Please add your API key to the application.properties file

And the frontend shows this error:

Screenshot 2025-11-06 at 9 53 57 AM

We should probably be handling this with an HTTP status code - I guess a 401 Unauthorized - which we could display in the frontend.

Presumably we don't have time to scope this for MVP, but as a fast follow, we should scope unifying the error handling across the server backends to throw the appropriate HTTP error codes and handle those in the frontend.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good callout, I agree, I think we need some error handling here and probably a general error page. Added to the list of fast follows

results.add(result);
ObjectId movieId = doc.getObjectId("_id");
movieIds.add(movieId);
scoreMap.put(movieId.toString(), doc.getDouble("score"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we're returning the score, but I don't see anything in the frontend where we expose this nor do I see it when the server is running.

I got some results that don't make sense to me when I did a few different searches, so it would be great to see the scores somewhere - either the UI, or as a console log from the server. Presumably this is OOS for MVP but I'd love to see it as a fast follow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add it to the UI, I could see it being part of the movie card potentially. Added to the fast follows list

@jordan-smith721 jordan-smith721 merged commit 8276d84 into mongodb:development Nov 6, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants