Skip to content
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

Python Azure Cognitive Search Connector expects existing ACS to have few fields which are required in code #2492

Closed
kshitijcode opened this issue Aug 18, 2023 · 2 comments
Labels
memory connector python Pull requests for the Python Semantic Kernel

Comments

@kshitijcode
Copy link
Contributor

kshitijcode commented Aug 18, 2023

I was trying to use AzureCognitiveSearchMemoryStore to query an existing Azure Cognitive Search resource not created through SK.

When I was trying to query it using

result = await connector.get_nearest_match_async("oaisyllabus-vector-index-new", results[0])

I got errors that the search document doesn't have the following fields

Id
Text
ExternalSourceName
Description
AdditionalMetadata
IsReference

Since my existing source doesn't have fields of the same name it was failing. On further debugging, I found these values to be hard coded in the connector code

SEARCH_FIELD_ID = "Id"
SEARCH_FIELD_TEXT = "Text"
SEARCH_FIELD_EMBEDDING = "Embedding"
SEARCH_FIELD_SRC = "ExternalSourceName"
SEARCH_FIELD_DESC = "Description"
SEARCH_FIELD_METADATA = "AdditionalMetadata"
SEARCH_FIELD_IS_REF = "IsReference"

Is this as by design that we cannot use existing ACS fields ? If no , then should we look for a way to parameterize it?

I am happy to raise a PR to make these corrections based on the way we proceed.

@shawncal shawncal added python Pull requests for the Python Semantic Kernel triage labels Aug 18, 2023
@kshitijcode kshitijcode changed the title Python Azure Cognitive Search Connector expects ACS to have few fields Python Azure Cognitive Search Connector expects existing ACS to have few fields which are required in code Aug 18, 2023
@evchaki evchaki removed the triage label Aug 21, 2023
@evchaki
Copy link
Contributor

evchaki commented Aug 21, 2023

@kshitijcode thanks for finding this. @awharrison-28 - would you like @kshitijcode to do a PR based on the info above?

@moonbox3
Copy link
Contributor

moonbox3 commented Mar 8, 2024

Closing this issue as the related PR has been closed. If there is further work needed around this please re-open an issue. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory connector python Pull requests for the Python Semantic Kernel
Projects
Archived in project
6 participants