New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Vespa Node's and indexing with additional fields #13356
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! 💯
Could you perhaps add a small section to the VespaIndexDemo.ipynb, demonstrating that one can obtain node.vespa_fields
as well?
node = metadata_dict_to_node(metadata) | ||
text = response_fields.get("body", "") | ||
node.set_content(text) | ||
node = self._vespa_hit_to_node(hit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a nice refactor! 🥇
try: | ||
# Try getting the local instance if available | ||
return VespaVectorStore(url="http://localhost", application_package=app_package, deployment_target="local") | ||
except ConnectionError: | ||
return VespaVectorStore(application_package=app_package, deployment_target="local") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, as this allows for faster development, as you said 👍
# I am not sure what to name this, so I decided a name that highlights the difference with hybrid_template | ||
# This needs to be renamed to something more meaningful | ||
with_fields_template = ApplicationPackage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good for now, and we can improve template naming once we get a better feel for use cases.
Hi great you liked it! I am overwhelmed with work on my side rn so can't say for sure but will try if I get some free time on my hands 🤟 |
|
||
|
||
class VespaNode(TextNode): | ||
vespa_fields: dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we need a new object class for this? I wonder if this could just be a metadata field?
Description
This PR adds support for indexing nodes to vespa with custom fields other than text and metadata.
Issue #13319
Motivation
A schema in Vespa has many fields that can be searched from and referenced in ranking profiles. This PR enables users to define the values for their vespa fields with a VespaNode.
Type of Change
How Has This Been Tested?
Suggested Checklist:
make format; make lint
to appease the lint godsNotes
Development decisions
Future Considerations
Note to maintainers
Please don't merge this before @thomasht86 reviews and confirms the changes