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

fix: search should work as (term1 and term2) #3865

Merged
merged 6 commits into from
Jun 20, 2024
Merged

Conversation

mswertz
Copy link
Member

@mswertz mswertz commented Jun 11, 2024

closes #3850

What are the main changes you did:

  • when using search as filter (not as part of seperate search parameter) it returned (term1 OR term2). Desire is to have it term1 AND term2
  • TEXT_SEARCH operator should be used in graphql api until TRIGRAM_SEARCH is better understood

how to test:

  • test search in variables user interface which uses this feature
  • see unit test

todo:

  • added/updated tests
  • added/updated testplan to include a test for this fix, including ref to bug using # notation

@mswertz mswertz marked this pull request as draft June 11, 2024 07:11
@mswertz mswertz self-assigned this Jun 11, 2024
@mswertz mswertz marked this pull request as ready for review June 11, 2024 08:00
Copy link

sonarcloud bot commented Jun 11, 2024

@EleanorHyde-UMCG
Copy link
Contributor

I can't get it to work in prev (no. 3865).

testdata in DEV:
'adhd' in search bar --> 14 variables
'maternal' in search bar --> 710 variables
'maternal adhd' and 'adhd maternal' in the search bar should give the same results i.e. somewhere between 710 and (710+14) variables (depending on how many match both criteria, impossible to know with this test data)

@mswertz
Copy link
Member Author

mswertz commented Jun 12, 2024

I can't get it to work in prev (no. 3865).

testdata in DEV: 'adhd' in search bar --> 14 variables 'maternal' in search bar --> 710 variables 'maternal adhd' and 'adhd maternal' in the search bar should give the same results i.e. somewhere between 710 and (710+14) variables (depending on how many match both criteria, impossible to know with this test data)

https://preview-emx2-pr-3865.dev.molgenis.org/catalogue-demo/ssr-catalogue/all/variables?page=1&conditions=[{%22id%22:%22search%22,%22search%22:%22adhd+mother%22}]

gives the desired results?

@EleanorHyde-UMCG
Copy link
Contributor

I can't get it to work in prev (no. 3865).
testdata in DEV: 'adhd' in search bar --> 14 variables 'maternal' in search bar --> 710 variables 'maternal adhd' and 'adhd maternal' in the search bar should give the same results i.e. somewhere between 710 and (710+14) variables (depending on how many match both criteria, impossible to know with this test data)

https://preview-emx2-pr-3865.dev.molgenis.org/catalogue-demo/ssr-catalogue/all/variables?page=1&conditions=[{%22id%22:%22search%22,%22search%22:%22adhd+mother%22}]

gives the desired results?

The filter works well and gives the same answer whether you put "termA termB" or "termB termA", only I just need to check why testvarNoRepeats is now shown (not aware that the word 'mother' is used on that one, but I'll check).

@EleanorHyde-UMCG
Copy link
Contributor

testvarNorepeats does not have the word 'mother' anywhere in it as far as I can see. If the search bar ALSO searches in the keywords, then you could use the following test data and test the different combinations of words entered:

image

@mswertz
Copy link
Member Author

mswertz commented Jun 12, 2024

testvarNorepeats does not have the word 'mother' anywhere in it as far as I can see. If the search bar ALSO searches in the keywords, then you could use the following test data and test the different combinations of words entered:

image

The search looks in columns of Variables table (and its superclass) as well as in the columns of the ontology terms that are referred (e.g. if the word is in description of an areas of information than it will be found)

@mswertz
Copy link
Member Author

mswertz commented Jun 13, 2024

Actually, keyword=Language also matches 'mother', see https://preview-emx2-pr-3865.dev.molgenis.org/CatalogueOntologies/tables/#/Keywords and then search for 'mother' because of 'mother tongue'

So not a bug in software unless we want to reduce the query expansion to exclude the descriptions of keywords.

@EleanorHyde-UMCG
Copy link
Contributor

Tested in prev 3865.
Search bar: "var" --> 132 variables, including non-test variables and all the test variables
Search bar: "var test" --> 20 variables, including non-test variables and all the test variables
Search bar: "var test vir" --> only 2 variables, both test variables with 'vir' in the name (and Virology as keyword)

@mswertz mswertz merged commit 676c8c7 into master Jun 20, 2024
6 checks passed
@mswertz mswertz deleted the fix/catalogue_search branch June 20, 2024 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants