nsandlin / linepig

ID resource for erigonine spiders, using KE Emu & IMu.
http://linepig.fieldmuseum.org/
4 stars 0 forks source link

Make search not case-sensitive #59

Closed nsandlin closed 1 year ago

nsandlin commented 3 years ago

In LinEpig search (https://linepig.fieldmuseum.org/search) it's especially a problem that Genus is case-sensitive. But we should probably remove it for all categories, as we've been talking about adding search by photographer (Creator) and/or the entity that lent the specimens or sent the image (Contributor) - open Issue #16 - and those, or possibly something else down the line, make have caps in the field value.

peteherbst commented 3 years ago

I have a fix in place for searching on genus, species. I will look into adding COLLATE NOCASE for searches in the future. It's a little bit more complicated.

For now, I'm forcing the genus to be properly cased, as you can see in this commit.

https://github.com/nsandlin/linepig/commit/e9aa1054a661cd6830a099dc23e20e2f0ed0f036

nsandlin commented 1 year ago

We belatedly realized that this fix was implemented as a side benefit of the switch to MongoDB (Aug 25, 2022). Text searching in MongoDB is case insensitive by default. (Although it turns out that the switch also changed the Boolean search logic from "and" to "or")