RNAcentral / rnacentral-webcode

RNAcentral website source code
https://rnacentral.org
Apache License 2.0
30 stars 9 forks source link

API search results not matching online search results #628

Closed joseph-siefert closed 3 months ago

joseph-siefert commented 4 months ago

Running a simple query give hits that differ from searching the site:

query = {
    'query': "AL121821",
    'fields': ['description','rna_type','expert_db','locus_tag'],
    'format': 'json',
}
response = requests.get('https://www.ebi.ac.uk/ebisearch/ws/rest/rnacentral', params=query)
data = response.json()
data

This gives 4 hits, none of which match the correct (and only) one returned when searching online.

Am I doing something wrong?

carlosribas commented 4 months ago

Hi @joseph-siefert,

Thanks for getting in touch, and for your interest in RNAcentral!

The query made by the website is different from the one you made. The difference is that the website adds a wildcard to all search terms that are not enclosed in double quotes. Therefore, this is the query made by our website: https://www.ebi.ac.uk/ebisearch/ws/rest/rnacentral?query=AL121821*&hlfields=description,expert_db,locus_tag,rna_type&format=json

If you require any further information, feel free to contact me.

Kind regards

joseph-siefert commented 4 months ago

Got it, thanks!