This time we have a new feature many thanks to cj. The new scoped search release now supports syntax similar to SQL IN and NOT IN. It is now possible to write the following syntax:
auth_level ^ (5,7,14)instead of having to do
auth_level = 5 OR auth_level = 7 OR auth_level = 14
Same goes for:
first_name !^ ('chris', 'peter')instead of having
first_name != 'chris' and first_name != 'peter'
Except for the new feature we have one bug fixed in this release.
Many thanks to Ohad Levy for taking the time to report the bugs.
The release is available to download from rubygems.org . Sources can be found in github
Yet another bug fixes release is available to download from rubygems.org. Sources can be found in github.
Changes from last release(2.3.5):
- when external methods create an empty conditions string, an invalid sql is produced.
- suggest value completion after operators without typing a space.
- safer code to prevent possible null pointer exception in the auto completer.
Many thanks to Brad Backingham and Steve Traylen for taking the time to report the bugs.
Another bug fixes release is available to download from rubygems.org. Sources can be found in github.
All the fixed bugs are related to the auto-completer component.
Changes from last release(2.3.4):
- value and key-name auto completer may produce abiguoes sql.
- fixed value auto-completer sql exception when single quote is used.
- fixed value completion after the first quotes.
- auto-completer fails when query starts with “or “
Many thanks to Brad Backingham, Eric Helms and Jeff Weiss for taking the time to report the bugs.
A new scoped_search bug fixes release is available to download from rubygems.org. Sources can be found in github.
Changes from last release(2.3.3):
- Fixed: Missing table name in the auto_completer distinct phrase may cause ambiguous sql query. Reported by Brad Backingham.
- Fixed: Null pointer exception on dot as a search string. Reported by Eric Thomas (https://github.com/wvanbergen/scoped_search/issues/14)
- Fixed: Foreman bug #1181: Host searching returns duplicates (or-ed facts). Reported and fixed by Tim Speetjens (http://theforeman.org/issues/1181 )
Many thanks to Brad Backingham, Eric Thomas and Tim Speetjens for taking the time to report bugs, and send patches.
A new scoped_search release is available 2.3.3
http://rubygems.org/gems/scoped_search/versions/2.3.3
2.3.2 was skipped by mistake. I made an error when running the release script.
Changes from last release(2.3.1):
- Auto-completer results can now be filtered, For usage see:
permission-model-for-the-search
- Fixed issue with decimal columns
https://github.com/wvanbergen/scoped_search/issues/12
- Auto completer ajax controller can now pass a filter parameter to the auto-completer method in addition to the search string.
usage:
<%= auto_complete_field_tag_jquery(
:search,
params[:search],
{:placeholder => 'Type Space for Search Options'},
{:filter => 'new filter option'}) %>
Scoped search uses ActiveRecord infrastructure to learn about the database schema. The auto-completer uses the column type to suggest the optional operators. Textual fields will have ‘~’ (like), ‘!~’ (unlike), ’=’ and ‘!=’. Numerical fields will have ‘>’, ‘<’, ‘>=’, ‘<=’, ‘=’ and ‘!=’. Usualy this is something a developer using scoped search doesn’t need to worry about, scope search find the database column type and suggest the relevant operators, however there could be some cases where a developer will want to limit the operators set for a particular search term.
The syntax to control the auto-completer suggested operator list is to add :operators => { ‘=’, ‘!=’ } to the scoped_search command.
Multiplexing columns is an optimization used in some database schema. The idea is to store multiple integers or boolean values in a single integer column. The read and write operations are done using bit wise operators. For example we can store several flags in a single integer column, the first flag value is 1, the second 2, the third value is 4, etc.
Scoped search is able to expose multiplexed filed by specifying the offset and word size. In the common case of multiplexing booleans, the word size is 1.
scoped_search :on => :counters, :offset => 0 , :word_size => 6, :rename => :applied scoped_search :on => :counters, :offset => 1 , :word_size => 6, :rename => :skipped
The search syntax will expose the multiplexed column as multiple columns.