SOLR search example

How to programatically search for a term.

SOLR python example

an example using pysolr:


pip install vfb-connect pysolr

example looking for label/name match:

import pysolr

solr = pysolr.Solr('')

term = 'medulla'

results ='label:"' + term + '"')

{'iri': [''],
 'obo_id_autosuggest': ['FBbt_00003748', 'FBbt:00003748', 'FBbt 00003748'],
 'label_autosuggest': ['medulla', 'medulla', 'medulla'],
 'synonym_autosuggest': ['ME', 'Med', 'optic medulla', 'm'],
 'label': 'medulla',
 'synonym': ['ME', 'Med', 'optic medulla', 'm'],
 'short_form': 'FBbt_00003748',
 'autosuggest': ['medulla', 'ME', 'Med', 'optic medulla', 'm'],
 'facets_annotation': ['Entity',
 'unique_facets': ['Nervous_system', 'Adult', 'Synaptic_neuropil_domain'],
 'id': '',
 'shortform_autosuggest': ['FBbt_00003748', 'FBbt:00003748', 'FBbt 00003748'],
 'obo_id': ['FBbt:00003748'],
 '_version_': 1734360220689235970}

Note: any of the above fields can be searched (autosuggest being a combination of both label and synonyms)

Last modified September 29, 2022: Create (e5eed64)