Back to Changelog
Featurev1.5.0

SDK v1.5.0: Bulk Search for Python & R

Python and R SDKs now support bulk lexical and semantic search - up to 50 queries in a single API call.

SDK v1.5.0 is out for both Python and R, adding bulk search support for the Bulk Semantic Search API we launched last week. Process dozens of clinical terms in one request instead of making individual calls.

Submit up to 50 keyword searches in a single API call. Each search gets a unique search_id so you can match results back to your input:

# Python
results = client.search.bulk_basic([
    {"search_id": "q1", "query": "diabetes mellitus"},
    {"search_id": "q2", "query": "hypertension"},
    {"search_id": "q3", "query": "aspirin"},
], defaults={"vocabulary_ids": ["SNOMED"], "page_size": 5})

for item in results["results"]:
    print(f"{item['search_id']}: {len(item['results'])} concepts")
# R
results <- client$search$bulk_basic(list(
  list(search_id = "q1", query = "diabetes mellitus"),
  list(search_id = "q2", query = "hypertension"),
  list(search_id = "q3", query = "aspirin")
), defaults = list(vocabulary_ids = list("SNOMED"), page_size = 5))

for (item in results$results) {
  cat(sprintf("%s: %d concepts\n", item$search_id, length(item$results)))
}

Submit up to 25 natural-language queries with neural embedding search. Ideal for NLP pipelines, clinical note processing, or any workflow that needs high-confidence concept matching across many terms:

# Python
results = client.search.bulk_semantic([
    {"search_id": "s1", "query": "heart failure treatment options"},
    {"search_id": "s2", "query": "type 2 diabetes medication"},
], defaults={"threshold": 0.5, "page_size": 10})

for item in results["results"]:
    print(f"{item['search_id']}: {item.get('result_count', 0)} matches")
# R
results <- client$search$bulk_semantic(list(
  list(search_id = "s1", query = "heart failure treatment options"),
  list(search_id = "s2", query = "type 2 diabetes medication")
), defaults = list(threshold = 0.5, page_size = 10))

for (item in results$results) {
  cat(sprintf("%s: %d matches\n", item$search_id, length(item$results)))
}

Shared Defaults with Per-Query Overrides

Set common filters once in defaults, then override per query where needed:

results = client.search.bulk_basic([
    {"search_id": "conditions", "query": "diabetes", "domain_ids": ["Condition"]},
    {"search_id": "drugs", "query": "metformin", "domain_ids": ["Drug"]},
], defaults={"vocabulary_ids": ["SNOMED", "RxNorm"], "page_size": 5})

Install or Upgrade

# Python
pip install --upgrade omophub
# R
install.packages("omophub")

Resources