anki/ftl
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
..
core Add option to exclude fields from search (#2394) 2023-03-20 07:46:03 +10:00
core-repo@8cd712fcde Update translations 2023-03-11 17:51:02 +10:00
qt Implement TTS using windows crate (#2371) 2023-02-17 12:26:07 +10:00
qt-repo@10156e736e Update translations 2023-03-11 17:51:02 +10:00
usage Add Rust bin to deprecate unused ftl entries (#2364) 2023-02-07 11:56:14 +10:00
.gitignore Add Rust bin to deprecate unused ftl entries (#2364) 2023-02-07 11:56:14 +10:00
Cargo.toml Update Rust deps (#2332) 2023-01-18 22:24:29 +10:00
duplicate-string.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
extract-strings.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
format_check.py run black/isort on Python scripts 2021-04-14 18:22:02 +10:00
format.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
README.md fix documentation links 2021-06-03 16:51:03 +10:00
remove-unused.sh Don't store used FTL keys in git 2022-04-09 12:38:54 +10:00
sync.rs Switch Rust import style (#2330) 2023-01-18 21:39:55 +10:00
transform-string.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
update-ankidroid-usage.sh Add Rust bin to deprecate unused ftl entries (#2364) 2023-02-07 11:56:14 +10:00
update-ankimobile-usage.sh Add Rust bin to deprecate unused ftl entries (#2364) 2023-02-07 11:56:14 +10:00

Files related to Anki's translations.

Please see https://translating.ankiweb.net/anki/developers