Allow to fast search/filter items on lists (like operations) on specific a column only. For example, filter (diplay) only operation that contains 'thing' only in comment. A operation with 'thing' on payee wil not be displayed. I suggest to use column:text format, with ':' separator, to restrict search on a specific column. 'column' is a column name or the begining of a column name. For example, to search only in Comment, 'co:text' will be enough. Which column to use if column name correspond to multiple columns ? To backward compatibility, I suggest to allow quote (single and double) on search string. "c:text" will search c:text on all columns. This also allow to search with + and - char (normally used to refine search terms) and moreover to allow search with space: "text text" with search only this string without cutting the string in two OR search. Reproducible: Always Steps to Reproduce: 1. enter column:text in search/filter box on lists Actual Results: filter row that contains column:text on all columns Expected Results: filter row that contains text on all columns that name starts with 'column' See discussion on https://forum.kde.org/viewtopic.php?f=210&t=125653&p=332073#p332073
I suggest to modify SSKGServices::KGSearchCriteria to add a 'QString column' (peharps too specific or columnName (even more precise) or name (more generic). SKGServices::stringToSearchCriterias will fill list of criteria with this rules: - if quote (single or double), take all chars without analyse until end of quote, and remove quote - if ':' char, split string and fill column data - +/- chars are analysed as before In SKGSortFilterProxyModel::filterAcceptsRowWords (and in others sources where criteria is used), compare criteria column name (if exists) with column name (in header) before checking text.
After reviewing current code, I discover that +/- chars define OR condition search and spaces define AND. Example: +abc +def => abc somewhere OR def somewhere => 2 criterias, 1 word each +abc def => abc somewhere AND def somewhere => 1 criterias, 2 words So I think 'column' data should be associated with word and not criteria. criteria: - type - list of: . word . column
Git commit c0270dfbbf0bd211684d4713a6ec825ffd75a4fb by Stephane Mankowski. Committed on 31/03/2015 at 20:53. Pushed by smankowski into branch 'master'. Enhance fast search/filter on lists M +1 -0 CHANGELOG M +2 -0 TODO M +3 -0 skgbasegui/skgfilteredtableview.ui M +15 -3 skgbasegui/skgsortfilterproxymodel.cpp M +2 -2 skgbasemodeler/skgservices.cpp M +20 -0 tests/skgbasemodelertest/skgtestbase.cpp http://commits.kde.org/skrooge/c0270dfbbf0bd211684d4713a6ec825ffd75a4fb
Hi vicnet, Could you test it and reopen this bug if you are not satisfied by the developement? Regards, Stephane
All is fine except use of quotes. For spaces, it is OK. But I expect that "e:" (with quotes) filter lines that contains really the two chars 'e' + ':'. In fact, quote are removed before ':' test so "e:" is interpreted as e: so it not filter any line as word after ':' are empty... I think SSKGServices::KGSearchCriteria should deals with separator manipulation... and not ProxyModel. Peharps add some 'hints' also in tip of the day. Tooltip is not condensed as other tooltips. Lines/Phrases are separated by some spaces. Not a big pb but disgracefull...
Git commit f80ea56a5546d8419f25e55ce1bfec843e0c4488 by Stephane Mankowski. Committed on 01/04/2015 at 14:26. Pushed by smankowski into branch 'master'. Enhance fast search/filter on lists M +17 -4 doc/index.docbook M +1 -1 skgbasegui/skgfilteredtableview.ui M +4 -2 tests/skgbasemodelertest/skgtestbase.cpp http://commits.kde.org/skrooge/f80ea56a5546d8419f25e55ce1bfec843e0c4488
Hi vicnet, I don't want to complexify too much the code. I updated the tooltip. As you can see, if you want to search "e:f" on all attributes you have to enter ":e:f" (without cotes). I have a question: The optional character ":" is used to mean "containing", what do you thing if we add the support of ">" or "<" ?
">" and "<" for real number comparisons ? Or different signification (instead ':' char) ?
In fact "<" and ">" could be use to compare numbers, dates, string. For example: amount>50 will keep operations having greater than 50. date>2015-01-01 will keep operations since 1st Jan 2015.
Oh yes I see. And I like this because it is a generalization of ':', sort of "column operator word" with different operators like ':', '>', '<'... Currently ':' is 'contains' '=' could be exactly equal '>', '<' as you said ...
Git commit 2aaaafd99d7ddd8a0e0b77db1886b843e79fb2c8 by Stephane Mankowski. Committed on 02/04/2015 at 20:42. Pushed by smankowski into branch 'master'. Enhance fast search/filter on lists M +8 -5 doc/index.docbook M +1 -1 skgbasegui/skgfilteredtableview.ui M +94 -34 skgbasegui/skgsortfilterproxymodel.cpp M +3 -0 skgbasegui/skgsortfilterproxymodel.h http://commits.kde.org/skrooge/2aaaafd99d7ddd8a0e0b77db1886b843e79fb2c8
Could you try it? Examples: Amou>100 Date>2015-03-25
Git commit 62e5a687dd6b4555824f786add4e1a1d941f3c49 by Stephane Mankowski. Committed on 03/04/2015 at 18:19. Pushed by smankowski into branch 'master'. Enhance fast search/filter on lists M +1 -0 doc/index.docbook M +1 -1 skgbasegui/skgfilteredtableview.ui M +1 -1 skgbasemodeler/skgservices.cpp M +2 -2 tests/skgbasemodelertest/skgtestbase.cpp http://commits.kde.org/skrooge/62e5a687dd6b4555824f786add4e1a1d941f3c49