qwacko / totallatorv3

A thorough book keeping and reporting web app.
https://qwacko.github.io/totallatorv3/
MIT License
0 stars 0 forks source link

Improved Text Filtering #99

Closed qwacko closed 6 months ago

qwacko commented 6 months ago

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:

any 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.

qwacko commented 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.

qwacko commented 6 months ago

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.