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

Write boolean logic/pseudocode for mapping search #2023

Open
paynejd opened this issue Nov 25, 2024 · 1 comment
Open

Write boolean logic/pseudocode for mapping search #2023

paynejd opened this issue Nov 25, 2024 · 1 comment
Assignees
Labels

Comments

@paynejd
Copy link
Member

paynejd commented Nov 25, 2024

Please write out the search that is being performed (e.g. as boolean logic/pseudocode) for the prototype matching/mapping endpoint.

This serves as a good example of how advanced search might be structured.

@snyaggarwal
Copy link
Contributor

snyaggarwal commented Nov 26, 2024

Given an input row in the format:

{
    "target_repo_url": "/orgs/CIEL/sources/CIEL/v2024-10-04/",
    "row": {
        "id": 5,
        "name": "Tetracycline",
        "description": "",
        "synonyms": [
        ],
        "concept_class": "Drug",
        "datatype": "N/A",
        "same_as_mapped_codes": [],
        "other_map_codes": []
    }
}

Search algo:

  1. $resolve the target_repo_url to a repository version -- this becomes first and only filter clause
  2. Apply match_phrase search criteria on the following fields with corresponding result boost:
        ['id', 10],
        ['name', 8],
        ['synonyms', 6],
        ['same_as_mapped_codes', 5],
        ['other_map_codes', 3],
        ['concept_class', 'datatype', 3],

  1. Apply wildcard search criteria on name and synonyms using wildcard string name* with a boost of 1 and case-insensitive
  2. Apply fuzzy search criteria on name and synonyms with a boost of 0 and max_expansion 3
  3. Apply fuzzy search criteria on name and synonyms individual words with a boost of 0 and max_expansion 3
  4. Highlight fuzzy, wildcard and match_phrase fields if they matches
  5. Sort by score desc.

snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Dec 3, 2024
snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Dec 6, 2024
snyaggarwal added a commit to OpenConceptLab/oclweb3 that referenced this issue Dec 10, 2024
snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Dec 10, 2024
snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Dec 12, 2024
snyaggarwal added a commit to OpenConceptLab/oclweb3 that referenced this issue Dec 12, 2024
snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Dec 12, 2024
snyaggarwal added a commit to OpenConceptLab/oclweb3 that referenced this issue Dec 12, 2024
…tched synonyms | concept details -> highlight matches
snyaggarwal added a commit to OpenConceptLab/oclweb3 that referenced this issue Dec 13, 2024
snyaggarwal added a commit to OpenConceptLab/oclweb3 that referenced this issue Dec 16, 2024
snyaggarwal added a commit to OpenConceptLab/oclweb3 that referenced this issue Jan 2, 2025
snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Jan 2, 2025
snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Jan 2, 2025
snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Jan 2, 2025
snyaggarwal added a commit to OpenConceptLab/oclweb3 that referenced this issue Jan 3, 2025
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

2 participants