0%

How to perform a query: q parameter

q is a mandatory Solr parameter that defines the query. This includes boolean operators, quotation marks, parentheses, wildcard characters such as asterisks and question marks, range operators, proximity searches, and more. We will learn more in the following sections.

Let’s try to request everything from one core using the command below:

num_found, df = solr_request(
    core='statistical-result', 
    params={
        'q': '*:*'
    }
)

Take into account that this request returns only the first 10 documents by default. To request everything effectively, we need to use the batch_solr_request function and pagination. In the following sections, you will learn how to download large amounts of data, but for now, we will focus on using the solr_request function for prototyping.

Let’s do our first exercise!