Bauble / bauble.classic

this is how Bauble and Ghini both started
GNU General Public License v2.0
10 stars 34 forks source link

search »genus species« matches too much #192

Closed mfrasca closed 8 years ago

mfrasca commented 8 years ago

when you type the binomial name of a species, the search strategy that is invoked retrieves all that match either the genus or the species epithet. it would be nicer if it would only retrieve those that match both criteria. so if I type »Mangifera indica« I will see the genus »Mangifera« and all species with species epithet »indica« I suggest we add a new search strategy to be activated if the user inserts two names, the first of which capitalized (as dictated by binomial naming). the new search strategy could let the user insert partial names, so you could manage to locate »Cyclopogon lindleyanus (Link, Klotzsch & Otto) Schltr.« by looking for »Cyclo lindl« (something similar could be achieved by on-the-fly completion, but still we miss the search strategy.)

RoDuth commented 8 years ago

Just a though here, but how about searches enclosed in quotation marks? Logic to me for searching is that quotation marks means searching for the whole string verbatim, letter for letter, case sensitive, etc. and as far as I can make out Bauble currently only supports quotations if the string is within a single field.

For example: Searching 'Acmella grandiflora var. brachyglossa' will get me anything containing Acmella, grandiflora, brachyglossa &/or var (i.e. it will even return Tovariaceae as it contains var) but searching '"Acmella grandiflora var. brachyglossa"' should only get me something with the full string, which in most situations should only be the taxon by that name. So in other words a short cut to "species where genus.genus = Ficus and sp = congesta and infrasp1_rank = var. and infrasp1 = congesta". And if I search '"Acmella grandiflora"' I should get all the varieties, sub species, cutivars, that exist. I know this doesn't solve the partial name issue though. Just a thought...

(p.s. 'species where genus.genus like Acmel% and sp like grandi%' has worked for me in the past... but its a lot more work than what your solution!)

mfrasca commented 8 years ago

thinking of how Bauble selects and applies the different search strategies, I think it's easier to add what I propose, a new search strategy which assumes the first item is a genus epithet (if capitalized) and the second a species epithet. this could be extended—as you say—to varieties, formae, maybe cultivars, but at the beginning I would limit it to the basic binomial naming.

mfrasca commented 8 years ago

does not yet match varietates nor formae. if »Acmella grandiflora var. brachyglossa« is in the database, this should be returned when looking for »Acmella grandiflora«.