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

Filter on single feature #133

Open
Emix26 opened this issue Dec 23, 2022 · 2 comments
Open

Filter on single feature #133

Emix26 opened this issue Dec 23, 2022 · 2 comments

Comments

@Emix26
Copy link

Emix26 commented Dec 23, 2022

Hi there,
Thanks for this nice tool to get familiar to Azure cognitive skills. I have a question related to the checkbox list on the left. I would like to filter based on feature of the path of the documents. I managed to extract the path from the metadata and feed it to the checkbox list. However, when I click nothing happens. I think it's related to the filter that runs in the background when clicking on a checkbox. I think it's related to this specific line:

// TODO: Only collection filter implemented.

Where this expects a collection of strings while the path is a single string. Am I correct ? If yes, how do I change that such that the filter accepts the path as input ?

@Careyjmac
Copy link
Collaborator

I believe the "filter" list as implemented actually uses the faceting feature of Azure Cognitive Search, so you would need to change the metadata field in your index to be facetable in order for this to work. References:

new SearchField("entities", SearchFieldDataType.Collection(SearchFieldDataType.String)) { IsSearchable = false, IsFilterable = true, IsHidden = false, IsSortable = false, IsFacetable = true },

@Emix26
Copy link
Author

Emix26 commented Dec 29, 2022

Thanks for your answer. Indeed, I think so too. But to filter on the file path, I added this search field:

new SearchField("filePath", SearchFieldDataType.String) { IsSearchable = false, IsFilterable = true, IsHidden = false, IsSortable = false, IsFacetable = true  },

This seems to work as the filepaths are properly displayed on the left pannel. However, when I click on one of the checkbox, nothing happens (the checkboxes disappear and the result of the query as well). This lead me to believe that there is an issue with the fact that the filter expects a list or a collection of string, while I'm now passing only one string. Is there a way to filter on that string alone ? The behaviour that I would like is that when I click on the checkbox only the result of that document are shown.

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

No branches or pull requests

2 participants