Skip to content

Add exact mode#273

Open
gaurav wants to merge 2 commits into
cifrom
add-exact-mode
Open

Add exact mode#273
gaurav wants to merge 2 commits into
cifrom
add-exact-mode

Conversation

@gaurav
Copy link
Copy Markdown
Collaborator

@gaurav gaurav commented Jun 2, 2026

WIP

Closes #258.

gaurav and others added 2 commits June 2, 2026 17:19
Adds an `exact` parameter (label/synonyms/any) to /lookup and /bulk-lookup.
When set, the eDisMax query is bypassed entirely in favour of a Solr filter
query against the *_exactish fields (KeywordTokenizer + LowerCaseFilter).
Filter queries are cached by Solr, so repeated exact lookups of the same term
are fast after the first hit — the intended use case is NER pipelines doing
bulk exact-string lookups.

Also switches bulk_lookup() from a sequential for-loop to asyncio.gather(),
sending all N Solr requests concurrently instead of one at a time.

Closes #258

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Uses HP:0001300 (preferred_name="parkinsonian disorder", names=["Parkinsonian
disease"]) as the test case, since its preferred name is absent from the names
list — cleanly separating label-only vs. synonym-only matching.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant