pittquantum / PittQuantumRepository

Flask backend for the Pitt Quantum Repository website
https://pqr.pitt.edu/
MIT License
16 stars 5 forks source link

One Search Result -> Direct to /mol/ page #4

Closed ghutchis closed 9 years ago

ghutchis commented 9 years ago

If there's only one search result, we shouldn't bother to show the "browse" interface and instead go to the exact page (e.g., with a redirect).

JoshuaRogan commented 9 years ago

We actually discussed this issue. I said we should stay with the browse interface only because I was thinking of the browse page also as a page to look at a couple different molecules at a time. I was thinking you can actually search for two inchi keys and compare, at the least visually, the molecules. We actually already have the code to detect if there is an exact matching result.

RitwikGupta commented 9 years ago

I wanted to go straight to the molecule page, but I feel like in the end showing the results page is better.

ghutchis commented 9 years ago

Can you explain why you think showing the results is better? I'd rather have an exact matching result go directly to the page. If someone searches for two keys, they get two results, so browse works.

If I search for "aspirin" I most likely want to go to aspirin.

JoshuaRogan commented 9 years ago

At the current moment our search isn't as robust as we'd like. It is possible for a query to give one result and be not what the user is looking for.

If you give exactly one Inchi key I'm okay with it going right to the molecule page or any other primary key.

ghutchis commented 9 years ago

Can we re-visit this, now that the search is better? I'd really like "aspirin" to go directly to the page.