0%

How to get specific fields: fl parameter

To make the query more effective and retrieve only the needed data, the fl (field list) parameter can be used. It limits the information included in a query response to a specified list of fields.

Information about available IMPC fields for each core is available here.

Warning! If you misspell a field name, it will be silently removed from the output. You can turn on the validate flag, which returns a warning if the spelling is not present in the list of available fields.

num_found, df = solr_request(
    core='statistical-result', 
    params={
        'q': '*:*',
        'fl': 'marker_symbol,top_level_mp_term_name,effect_size,p-value',
        'rows': 3
    },
    validate=True
)

In the example above, the validate flag was set to True, and three documents from the statistical-result core were requested. Only four fields were specified:

  • marker_symbol
  • top_level_mp_term_name
  • effect_size
  • p-value