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

Cant get ClientFiltering to work #518

Closed
1 of 5 tasks
kmaramr opened this issue Nov 15, 2022 · 2 comments
Closed
1 of 5 tasks

Cant get ClientFiltering to work #518

kmaramr opened this issue Nov 15, 2022 · 2 comments
Labels

Comments

@kmaramr
Copy link

kmaramr commented Nov 15, 2022

Describe the bug
We are trying to use ClientFiltering to segregate questions into department scopes. None of the questions seem to work (we have set the ClientFilterValue for all the questions). Once we remove it we get a hit. Cloud watch logs show no_hits when its set.

To Reproduce

  • Set the "clientFilterValues" on the questions being deployed.
  • Set the lex sessions attribute "QNAClientFilter" on the test page.

Expected behavior
Expect to see the response from the es query. And not the no_hit match.

Please complete the following information about the solution:

  • QnaBot version: 5.2.1
  • Lex web ui version: 0.19.6

To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "(SO0189) QnABot [...] v0.0.1".

  • Region: [e.g. us-east-1]
  • Was the solution modified from the version published on this repository?
  • If the answer to the previous question was yes, are the changes available on GitHub?
  • Have you checked your service quotas for the sevices this solution uses?
  • Were there any errors in the CloudWatch Logs?
    log-events-viewer-result.csv
@kmaramr kmaramr added the bug label Nov 15, 2022
@t-jones
Copy link
Contributor

t-jones commented Nov 19, 2022

Looks like the issue in this case is due to using the term operator for clientFilterValue, which only does an exact match. The clientFilterValue used was capitalized. The field is a text field and subject to the analyzer, so it was transparently being lowercased, which caused the match to fail.

https://github.com/aws-solutions/qnabot-on-aws/blob/main/lambda/es-proxy-layer/lib/esbodybuilder.js#L82

https://opensearch.org/docs/latest/opensearch/query-dsl/term/#term
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html

cc: @chrislott

@ihmaws
Copy link
Member

ihmaws commented Jan 4, 2023

Thank you @kmaramr for the report and @t-jones for the fix.

Fixed as of v5.2.5

@ihmaws ihmaws closed this as completed Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants