- Course overview
- Search within this course
- Overview of key IMPC concepts and tools
- Introduction to the Solr API: accessing IMPC data programmatically
- What is Apache Solr?
- Important definitions: query, field, core, document, parameter
- Quiz 2: get yourself familiar with Solr terminology
- What is the difference between an IMPC parameter and a Solr parameter?
- Using simple Solr syntax in your browser
- Output of the simplest request in your browser
- A Python module to access IMPC data: installation and available functions
- Quiz 3: explain Solr request
- Filtering data in Solr: narrowing down your results
- How to query a specific field: filter by value
- Exercise 4: filtering by a single field
- How to filter numbers: range search
- Exercise 5: changing the p-value threshold
- How to combine multiple filters: Boolean operators
- Exercise 6: applying multiple filters
- How to exclude data: NOT operator
- Why parentheses are important: combine multiple Boolean operators
- Quiz 5: Boolean operators
- How to handle with null values: exclude empty fields
- Exercise 7: explore null values
- Downloading data: getting large results efficiently
- How to download large dataset effectively: pagination
- How to download the data: batch_solr_request function
- What formats are available for downloading: wt parameter
- Exercise 8: download the data
- What is the difference: JSON vs CSV
- What you need to keep in mind: query responsibly
- Quiz 6: request only necessary data
- Advanced Solr query techniques: faceting and iterating over entities
- Understanding IMPC data: resources and assistance
- Your feedback
How to use the solr_request function from the impc-api python package
The solr_request function performs a single Solr request to the IMPC Solr API.
Here is an example:
num_found, df = solr_request(
core='statistical-result',
params={
'q': '*:*'
}
)
The solr_request function uploads the found data as a pandas DataFrame. It requires two parameters:
- core: The name of the IMPC Solr core.
- params: A dictionary containing the Solr API call parameters.
This function is useful for short queries and prototyping, particularly if you need to download a large dataset later on. In the output of the solr_request function, you will find:
- The URL with your request, containing encoded special characters, which can be opened in the browser.
- The number of found documents.
- A pandas DataFrame with the retrieved data.

Figure 4. Output of solr_request function.