FAQ | This is a LIVE service | Changelog

Skip to content

Advanced search uses ranges for numeric types

Numeric types are used in Chemistry's database, and we want to be able to search for amounts in a range on numeric columns. RT-237037 . This adds range functionality for Advanced searches on numeric columns. The form of SQL search used is 'BETWEEN min AND max', which follows what was previously done for dates.

This revealed a bug, in that if one makes an advanced range search for a date/time/numeric (ie generating SQL 'WHERE column BETWEEN minval AND maxval') and then ticks the 'exclude' box the expected search of 'WHERE NOT BETWEEN minval AND maxval' is carried out, but the GUI incorrectly displays 'Showing records where: after and before ', which is not the search that's actually happening.

The code that generates the GUI's representation of the search has therefore been updated to use the wording 'Showing records where: (not) between and ', with 'not' appearing when the 'exclude' box is ticked. This matches the SQL search that's happening and is more readable as it avoids the awkwardness of 'after' and 'before' for non date/time columns.

When Hotwire is displaying search results in list view the human-readable representation of the search can be clicked on to bring up a QuickSearch popup box allowing the user to quickly adjust the search parameters. The QuickSearch box doesn't fully support ranged searches; Hotwire tries to represent them to it as a combined 'greater than minval' and 'less than maxval' pair of searches. This causes inconsistency when the search sense is inverted: NOT (A AND B) is not the same as NOT A AND NOT B, so editing a ranged search via the quicksearch box leads to search results that do not match the displayed representation of the search. Making advanced search ranged search work consistently and correctly with the Quicksearch box needs much bigger changes, so for now the ability to click on a ranged search representation to edit it via the quicksearch box has been removed.

Closes #4 (closed)

Closes #4 (closed)

Merge request reports