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

Freetext search for a keyword which is also a common field name returns all records #9003

Open
garethbowen opened this issue Apr 11, 2024 · 0 comments
Labels
Type: Bug Fix something that isn't working as intended

Comments

@garethbowen
Copy link
Member

Describe the bug

The search index indexes all documents by their fields, with an additional advanced feature of prefixing the search with the field name. For example, this doc:

{
  "name": "gareth"
}

Will by indexed by: "gareth", "name:gareth".

The idea is users can search for "name:gar" to ignore docs with a value starting with "garage" in another field. The problem is when someone searches for "nam" then every doc with a "name" field is returned.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Contacts tab
  2. Search for "nam"
  3. See all contacts returned

Expected behavior

Only a subset of contacts should be returned - those with a field value that starts with "nam".

Screenshots

image

Environment

  • Instance: any
  • Browser: any
  • Client platform: any
  • App: webapp
  • Version: any

Additional context

Raised on the forum: https://forum.communityhealthtoolkit.org/t/unexpected-search-results/3288/16

@garethbowen garethbowen added the Type: Bug Fix something that isn't working as intended label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix something that isn't working as intended
Projects
None yet
Development

No branches or pull requests

1 participant