Closed qwacko closed 6 months ago
Maybe multiple of the same could be or'ed together, and then for inputs taht currently don't allow ored values add this functionality.
Also, for the plain text, maybe make each work be ored together, with the option of using quotes to search for specific text. i.e. McDonalds "Burger King"
would be the equivalent to "McDonalds" | "Burger King"
and would search for items that have either McDonalds or Burger King in the description or account.
Here is teh regex to split out the input text into its parts:
\b\w+:"[^"]*"|\b\w+:[^\s]*|"[^"]*"|\S+
This turns the input this person "Burger king" tag:something tag:"something else"
into ['this', 'person', 'Burger king', 'tag:something','tag:"something else"']
which can then be easily transformed into a search query.
It would be much more powerful if the filtering text allowed for input of more specific text filters (similar to firefly-iii) which were then transformed to a json object in the backend.
For example:
account:xxxxx
: Journal Entry Has Account Name!account:xxxx
: Journal Entry Does No Not Have Account NameotherAccount:xxx
: Related Journal Enrtries have account namemax:xxx
: Maximum amountearliest:YYYY-MM-DD
: Earliest Datelatest:YYYY-MM-DD
: Latest Datetime:"This Year"
: Allows for selection of pre-configured time spans.tag:xxx
: Tag NametagGroup: xxx
: Tag Grouptype:Asset|Liability
: Account TypeisCash:true
: Account Is Cashany value without a prefix would still search the account and description as it currently does. If multiple of the same prefixes are added, then there will either need to be an error, or some additional logic that currently doesn't exist.
Note that this wouldn't capture all filter options, but the most used ones would be useful. This would also help in the creation of import filters.