Skip to main content

A wrapper for pySolr

Project description

Install

pip install -r requirements.txt
pip install .

Tests

python -m pytest

PEP

pep8

Usage

from pysolrwrapper.core import SolrQuery
from pysolrwrapper.filter import (FilterText, FilterColumnEnum)

    result = SolrQuery("localhost:9983", "omop-concept")\
        .set_type_edismax()\
        .select(["concept_id","concept_name"])\
        .add_filter(FilterText(["disease lethal", "patient"]))\
        .add_filter(FilterColumnEnum("standard_concept", ["c","s"]))\
        .add_filter(FilterColumnEnum("standard_concept", ["*"]))\
        .highlight(["concept_name", "synonym_concept_name"])\
        .facet(-1, ["standard_concept", "domain_id"])\
        .sort("score", "asc")\
        .sort("concept_id", "asc")\
        .limit(2)\
	.run()

Results

Depending on what you ask for, the result is a dictionnary with this format:

{'num_shown': 2,
 'num_found': 7052,
 'docs': [{'concept_id': '42742376',
           'concept_name': 'Molecular pathology procedure, Level 7'},
          {'concept_id': '2107646',
           'concept_name': 'Direct repair of aneurysm, pseudoaneurysm, or excision(partial or total) and graft insertion, with or without patch graft for ruptured aneurysm, abdominal aorta involving iliac vessels(common, hypogastric, external)'}],
    'facet_fields': {'standard_concept': [{'s': 6263},
                                          {'c': 789}],
                     'domain_id': [{'condition': 2870},
                                   {'measurement': 1621},
                                   {'observation': 1481},
                                   {'drug': 659},
                                   {'procedure': 303},
                                   {'meas': 100},
                                   {'value': 100},
                                   {'provider': 13},
                                   {'specialty': 13},
                                   {'device': 3}]
                     }
 }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysolrwrapper-1.0.0-py3.6.egg (9.5 kB view details)

Uploaded Egg

File details

Details for the file pysolrwrapper-1.0.0-py3.6.egg.

File metadata

  • Download URL: pysolrwrapper-1.0.0-py3.6.egg
  • Upload date:
  • Size: 9.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7

File hashes

Hashes for pysolrwrapper-1.0.0-py3.6.egg
Algorithm Hash digest
SHA256 5162dbb3ad23fd170fbc27480dc16986e76e2bbb8b372fca947408fe4896802a
MD5 f2e054d2cc07eab74bf6019dfb932412
BLAKE2b-256 4fbefa3112ecd49c4539d3d47101b640615777e2672cffe555e9b689e0f86d24

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page