MicrosoftLearning / mslearn-knowledge-mining

Lab files for Azure AI Knowledge Mining modules
https://microsoftlearning.github.io/mslearn-knowledge-mining/
MIT License
81 stars 152 forks source link

Issue with querying an indexed search solution #19

Closed bteleuca closed 5 months ago

bteleuca commented 9 months ago

I ran into an issue with my Exercise on creating a search solution. After indexing, querying the search with a select filter {"search": "London", "select": "url,sentiment,keyphrases", "filter": "metadataauthor eq 'Reviewer' and sentiment eq 'positive'"} resulted in the error: "Invalid expression: Could not find a property named 'url' on type 'search.document'. Parameter name: $select_". Consequently, the flask app returned the same error.

ivorb commented 5 months ago

this works fine in my instance. Are you confident the indexing was completed? if removing URL from the select statement, does it work?

hariscats commented 5 months ago

I reproduced the same error, and after removing the 'url' in the select parameter (of the search method), it does work.

ivorb commented 5 months ago

okay, I'll see if the parameter just changed or how to update it

scottrhay commented 5 months ago

I received this error today too. However, I think the issue was due to the prior script not running correctly. It gave me an error with the language property (that it already existed), so I deleted and recreated the index/skillset etc, and it still failed.

ivorb commented 5 months ago

@afelix-95 can you run through this, and see if the prior script is causing issues? Or if url no longer exists how the instructions expect?

afelix-95 commented 5 months ago

The problem is that in the instructions, the language index field is defined only as Retrievable and Filterable, while in the index.json it's also defined as Searchable. That makes the index update fail and not add the sentiment and url fields. To fix the issue, we need to select Searchable for the language field when customizing the index in the Azure portal.