Anki/rslib/src
Abdo 946eb46813
Add option to exclude fields from search (#2394)
* Add option to exclude fields from unqualified searches

* Use temp tables instead

This is slightly faster according to my (very rough) tests.

* Make query a bit more readable

* exclude_from_search -> excludeFromSearch

* Remove superfluous notetypes table from query

* Rework to use field search logic

Thanks to Rumo for the suggestion: https://github.com/ankitects/anki/pull/2394#issuecomment-1446702402

* Exclude fields from field searches too

* Fix error on notetypes with no included fields

* Add back the exclude_fields function

This approach seems to perform better on average than the previously
benchmarked ones.

* Use pure-SQL approach to excluding fields

* Change single field search to use new approach

* Fix flawed any_excluded/sortf_excluded logic

* Support field exclusion in the nc operator

Also fix search text being wrapped in % in the any_excluded=true case.

* Support field exclusion in the re and w operators

* Label field exclusion as being slower

* Unqualified search should be wrapped in % in all cases

I was under the impression that it shouldn't be wrapped with the new
field exclusion logic.

* Remove unnecessary .collect()

* Refactor some complex return types into structs

* Do not exclude fields in field searches

* Add a test and docstring for CollectRanges

* Avoid destructuring in closures

* Remove the exclude_fields function

Minor wording tweaks by dae:
* num_fields -> total_fields_in_note
* fields -> field_ranges_to_search
* fields -> fields_to_search
* SingleField -> FieldQualified
* mid -> ntid
2023-03-20 07:46:03 +10:00
..
backend Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
card Ensure state mutator runs after card is rendered (#2421) 2023-03-16 16:31:00 +10:00
card_rendering Implement TTS using windows crate (#2371) 2023-02-17 12:26:07 +10:00
collection Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
config Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
deckconfig Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
decks Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
error Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
import_export Fix invalid ids on import (#2449) 2023-03-20 07:04:59 +10:00
media Add option to tag notes with missing media (#2379) 2023-02-20 18:48:09 +10:00
notes Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
notetype Add option to exclude fields from search (#2394) 2023-03-20 07:46:03 +10:00
revlog Switch Rust import style (#2330) 2023-01-18 21:39:55 +10:00
scheduler Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
search Add option to exclude fields from search (#2394) 2023-03-20 07:46:03 +10:00
stats Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
storage Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
sync Implement HttpError directly so that sources can be extracted properly 2023-03-01 19:46:06 +10:00
tags Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
undo Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
adding.rs Switch Rust import style (#2330) 2023-01-18 21:39:55 +10:00
browser_table.rs Allow burying cards in browser (#2351) 2023-01-30 19:21:06 +10:00
cloze.rs Use backend for extracting cloze text to type 2023-01-18 23:05:28 +10:00
dbcheck.rs Fix invalid ids on import (#2449) 2023-03-20 07:04:59 +10:00
findreplace.rs Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
i18n.rs drop the legacy enum from rslib, and pass separate module/message idx 2021-03-27 11:56:31 +10:00
io.rs Fix backup creation for collections > 1 GiB (#2423) 2023-03-06 19:56:27 +10:00
latex.rs Switch Rust import style (#2330) 2023-01-18 21:39:55 +10:00
lib.rs Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00
links.rs Expose backend_proto publicly for AnkiDroid, and rename to pb 2022-06-27 15:27:53 +10:00
log.rs Update Rust deps (#2332) 2023-01-18 22:24:29 +10:00
markdown.rs Switch Rust import style (#2330) 2023-01-18 21:39:55 +10:00
ops.rs Global new ignore review limit (#2417) 2023-03-06 19:06:12 +10:00
pb.rs Integrate AnkiDroid's backend patches into the repo (#2290) 2023-01-03 13:11:23 +10:00
preferences.rs Switch Rust import style (#2330) 2023-01-18 21:39:55 +10:00
prelude.rs Global new ignore review limit (#2417) 2023-03-06 19:06:12 +10:00
serde.rs Update Rust deps (#2332) 2023-01-18 22:24:29 +10:00
template.rs Switch Rust import style (#2330) 2023-01-18 21:39:55 +10:00
template_filters.rs Switch Rust import style (#2330) 2023-01-18 21:39:55 +10:00
tests.rs Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
text.rs Export static references from sound tags (#2420) 2023-03-06 19:29:19 +10:00
timestamp.rs Switch Rust import style (#2330) 2023-01-18 21:39:55 +10:00
typeanswer.rs Fix excess missed markers in non-Latin text 2023-02-10 15:11:36 +10:00
types.rs update scheduling ops 2021-04-06 16:38:42 +10:00
version.rs Rework syncing code, and replace local sync server (#2329) 2023-01-18 12:43:46 +10:00