Henrik Giesel
47542f97e5
Fix issues after rebasing
2021-01-16 13:07:35 +01:00
Henrik Giesel
88c75d73b6
Pass in the the negative offset day to write_rated
2021-01-16 12:44:59 +01:00
Henrik Giesel
3788cb8890
Port prop:rated to EaseKind
2021-01-16 12:44:03 +01:00
Henrik Giesel
ce55dc4a75
Add nonfunctional "prop:rated" as possible search query
2021-01-16 12:42:06 +01:00
Damien Elmes
9686cd99ec
search error tweaks
...
- use markdown instead of HTML, to make editing and translating easier
- use a shared prefix
- a few very minor wording tweaks
- we don't need to translate undocumented command errors
- share a string for positive number of days
- share a string for invalid property and state arguments, and avoid
listing them out
Related discussion: https://github.com/ankitects/anki/pull/922
2021-01-16 15:59:19 +10:00
RumovZ
5b03d1e2c8
Add resched error tests
2021-01-15 10:57:55 +01:00
RumovZ
cb4a103bb1
Merge branch 'master' into search-errors
...
Add error support for new resched node, update rated error.
2021-01-15 10:50:02 +01:00
RumovZ
c8f0961c6c
Include context in search error test
2021-01-15 09:09:54 +01:00
RumovZ
182abfe66d
Encode HTML entities in search errors
2021-01-14 23:02:39 +01:00
RumovZ
2a2ac38a1b
Add search context for certain error kinds
2021-01-14 22:40:07 +01:00
RumovZ
5f05ca2548
Rename ParseErrorKind to SearchErrorKind
2021-01-14 22:00:52 +01:00
RumovZ
6af1852611
Add errorkind test
2021-01-14 19:10:12 +01:00
RumovZ
8f754e1525
Add FailKinds for unopened/unclosed groups
2021-01-14 19:09:31 +01:00
RumovZ
0b73110f82
Make AnkiError::SearchError work with ParseError
...
Use mock ftl strings for now.
2021-01-14 11:14:55 +01:00
RumovZ
4afb476f04
Fix text node parsers, add FailKind alias
2021-01-14 11:10:33 +01:00
RumovZ
d9bb20ac24
Expect backslashes to be escaped in dupe:
text
2021-01-14 10:42:37 +10:00
RumovZ
f4cfccfc0a
Fix writing dupe nodes
...
Rename comments and dupe functions on the backend accordingly to avoid
further confusion.
2021-01-14 10:42:37 +10:00
RumovZ
3aa15a7139
Optimise term parsers
2021-01-13 14:15:57 +01:00
RumovZ
447ff6931c
Move parse errors, add helper func for parse fail
2021-01-13 13:23:25 +01:00
Henrik Giesel
c0ec21b139
Rename EaseKind values
2021-01-13 11:41:48 +01:00
RumovZ
b89381ac95
Fix top-level search errorkinds
2021-01-12 17:32:26 +01:00
RumovZ
d00c54aacf
Switch parser to custom erros and results
2021-01-12 10:43:12 +01:00
Henrik Giesel
81d851610e
Coerce resched:days as well
2021-01-11 17:25:42 +01:00
Henrik Giesel
7a7152fe27
Remove EaseKind impl in favor of transforming to sql in function
2021-01-11 17:10:17 +01:00
Henrik Giesel
cbfe14ef4f
Introduce "resched:n" instead of 0 and a flag for "rated"
2021-01-11 16:40:30 +01:00
Henrik Giesel
7e58660aab
Modify default behavior of rated searches to exclude manual
2021-01-11 16:40:30 +01:00
Damien Elmes
401d5dd9cc
Merge pull request #917 from hgiesel/querynozero3
...
Coerce added/edited:0 to 1, Constrain rated:n to 1-365
2021-01-11 16:24:12 +10:00
Henrik Giesel
8f01887fe7
Remove coercion in write_rated
2021-01-10 16:23:53 +01:00
Henrik Giesel
87bc1e69b0
Coerce added/edited:0 to 1, constrain rated:n to 1 <= 365
2021-01-10 16:16:17 +01:00
RumovZ
9ef691c06f
Provide filter searches through backend
2021-01-09 10:50:08 +01:00
RumovZ
6ee9e4f58c
Merge branch 'master' of https://github.com/ankitects/anki into norm-search
2021-01-06 20:57:24 +01:00
RumovZ
84061a6e6d
Implement replace_search_term
2021-01-06 14:03:43 +01:00
abdo
dc51dc6795
Rename prop:order to prop:pos
2021-01-02 13:35:10 +03:00
abdo
0ad4619833
Support prop:order to search for new cards by order
2021-01-01 04:36:51 +03:00
Damien Elmes
a0b4948760
fix clippy error in unit test
2020-12-31 09:48:05 +10:00
cecini
d37ea0f5f7
Update rslib dep nom
2020-12-15 08:19:52 +00:00
RumovZ
540d52c471
Comment fix
2020-11-27 22:12:36 +01:00
RumovZ
0c9ad7e952
Revert implementation of r:
prefix
2020-11-27 22:10:37 +01:00
Damien Elmes
780f32b8ae
fix new Clippy lints
2020-11-25 09:12:19 +10:00
RumovZ
6e51bad7db
Implement the prefix r:
to search for raw input
2020-11-18 22:26:51 +01:00
RumovZ
b09a398d2d
Make - escapable
...
Treat unescaped - as before but make it escapable with \ to distinguish
the literal from the negator.
2020-11-17 18:38:27 +01:00
RumovZ
8c02c6e205
Split unescaping between parser and writer
...
* Unescape wildcards in writer instead of parser.
* Move text conversion functions to text.rs.
* Implicitly norm when converting text.
* Revert to using collection when comparing tags but add escape support.
2020-11-17 12:49:37 +01:00
RumovZ
7c5cf6d18b
Use enforced re to parse deck
...
Fix write_deck not recognising escaped deck name separators:
\:\: -> ::
2020-11-15 21:32:36 +01:00
RumovZ
a6628709c5
Annotate RegEx for invalid-escape check
2020-11-15 14:22:16 +01:00
RumovZ
a16d271eb0
Extend tests for new search parsing
...
(Also fix indentation)
2020-11-15 12:00:20 +01:00
RumovZ
ae01a5b3a2
Fix escape check for escaped backslash
2020-11-15 11:57:11 +01:00
RumovZ
63cc877023
Move whitespace check for tags from to sqlwriter
...
Instead of not parsing a tag containing whitespace, check for spaces
when writing sql and if there are any, explicitly match nothing.
2020-11-15 11:54:21 +01:00
RumovZ
57787368a1
Always use regex for tag search
...
Don't distinguish between the glob and no-glob cases when comparing
tags but always use regexp. Thus, avoid problems with SQL wildcards in
registered tags.
2020-11-15 09:52:00 +01:00
RumovZ
9e53481003
Fix tests for new search parsing (and reformat)
2020-11-14 19:13:09 +01:00
RumovZ
836977aac8
Fix whitespace in write_tag and parser/whitespac0
2020-11-14 19:10:56 +01:00
RumovZ
3949996728
For deck searches, unescape quotes only
...
For now, revert to the old handling of deck names using text_to_re from
text.rs and have parser.rs only unescape quotes.
2020-11-14 19:06:37 +01:00
RumovZ
b186e61e54
Fix 'escaped' parser for empty string
...
Fix a bug where 'escaped' parsers (nom) accepted the empty
string by wrapping them in 'verify' parsers.
2020-11-14 18:28:24 +01:00
RumovZ
0cff65e5a8
Fix bugs and inconsistencies in the search parser
2020-11-12 17:27:50 +01:00
Damien Elmes
9214c4a700
support did:[deck id] search
2020-09-03 16:43:22 +10:00
Damien Elmes
ac6397ae9e
add separate sched/user bury searches, and fix bury enums
2020-09-01 10:24:38 +10:00
Damien Elmes
a7e254e81d
catch leading/trailing boolean operators
...
https://forums.ankiweb.net/t/is-it-only-me-anki-giving-corrupt-collection-error/2424/20
2020-08-27 09:59:29 +10:00
Damien Elmes
01d20044e7
reject double comma in id list
...
https://forums.ankiweb.net/t/anki-2-1-29-and-below-2-small-bugs/1496
2020-07-29 13:05:34 +10:00
Damien Elmes
7cd02eea8f
supported edited:n
...
https://forums.ankiweb.net/t/feature-request-advanced-broswer-search-by-edited/268
2020-07-01 10:17:57 +10:00
Damien Elmes
d4cd4535e6
lint fixes
2020-06-29 15:53:56 +10:00
Damien Elmes
31a422cf85
fix partially quoted text not handling escaped quotes
...
https://forums.ankiweb.net/t/how-to-search-for-cards-containing-quotes/500/10
2020-06-29 15:48:01 +10:00
Damien Elmes
c77d017135
catch invalid regex in search
...
https://github.com/ankitects/anki/pull/652
2020-06-09 11:46:07 +10:00
Damien Elmes
7bab99d873
support disabling unicode normalization in notes
2020-05-12 21:13:34 +10:00
Damien Elmes
8dfd362fed
support globbing chars inside word boundary search
2020-04-25 09:43:08 +10:00
Damien Elmes
fd844a0d5a
add w: shortcut for searching on word boundaries
2020-04-25 08:48:01 +10:00
Damien Elmes
36ec7830a9
load/save note types in backend
...
This allows us to normalize bad data, and is the first step towards
splitting note types into separate tables.
2020-04-08 10:05:07 +10:00
Damien Elmes
0750ad5c62
fix duplicates search
2020-04-04 17:38:35 +10:00
Damien Elmes
f52e775354
NoteTypeID
2020-03-26 15:00:24 +10:00
Damien Elmes
430f1ad616
handle trailing whitespace inside group
2020-03-22 18:52:44 +10:00
Damien Elmes
9696e959be
increase the rated search cap to 365, and allow searches for ease 0
...
An add-on appears to use ease 0 when rescheduling cards, and it may
make sense for Anki to do the same in the future as well.
2020-03-21 16:05:17 +10:00
Damien Elmes
51a379de23
add search that ignores combining chars
...
On a test of a ~40k card collection, the 'ignore accents' add-on
takes about 1150ms, and this code takes about 70ms.
2020-03-21 15:15:59 +10:00
Damien Elmes
f0ed34d79b
support regexp search in single field
2020-03-21 13:06:46 +10:00
Damien Elmes
d1ebdbdcce
support regex searches
2020-03-21 12:00:48 +10:00
Damien Elmes
2aab44d9ce
support deck:"foo bar" style searches
2020-03-21 09:34:24 +10:00
Damien Elmes
c3314d3689
don't crash when card:0 passed in
2020-03-21 07:56:55 +10:00
Damien Elmes
224bad2566
handle empty searches and leading/trailing whitespace
2020-03-20 21:15:23 +10:00
Damien Elmes
c723adea17
fix escape handling, and handle sql wildcards
2020-03-20 21:15:23 +10:00
Damien Elmes
bca5f2ddff
prototype of integration
...
no ordering yet, and no tests
2020-03-20 21:15:23 +10:00
Damien Elmes
f559ae3ef8
address some clippy lints
2020-03-20 21:15:23 +10:00
Damien Elmes
91d7b02325
separate out template ordinal and name search
2020-03-20 21:15:23 +10:00
Damien Elmes
dcb2b46d1b
use .eq_ignore_ascii_case() to avoid allocating
2020-03-20 21:15:23 +10:00
Damien Elmes
00300bb24d
ensure rated ease in range
2020-03-20 21:15:23 +10:00
Damien Elmes
e790367b1e
ensure id list not empty
2020-03-20 21:15:23 +10:00
Damien Elmes
08d205d377
decode search terms in parser
2020-03-20 21:15:23 +10:00
Damien Elmes
289318d92c
split up searches with a qualifier
2020-03-20 21:15:23 +10:00
Damien Elmes
f623f19b3d
basic search parsing
2020-03-20 21:15:23 +10:00