anki/ftl/core
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
..
actions.ftl Make SpinBox chevrons more subtle (#2243) 2022-12-08 22:32:35 +10:00
adding.ftl Make missing cloze a warning again 2021-06-15 08:43:00 +02:00
browsing.ftl Add Rust bin to deprecate unused ftl entries (#2364) 2023-02-07 11:56:14 +10:00
card-stats.ftl Show custom data in stats screen 2023-02-07 12:27:43 +10:00
card-template-rendering.ftl Template err improvements (#1953) 2022-07-09 13:00:03 +10:00
card-templates.ftl More template checks (#2032) 2022-09-05 16:52:25 +10:00
change-notetype.ftl Change Notetype UI Rework (#1499) 2021-11-24 12:09:55 +10:00
custom-study.ftl Add Rust bin to deprecate unused ftl entries (#2364) 2023-02-07 11:56:14 +10:00
database-check.ftl Fix invalid ids on db check (#2445) 2023-03-19 10:58:35 +10:00
deck-config.ftl Revert bury restriction (#2432) 2023-03-11 17:49:18 +10:00
decks.ftl run ftl/remove-unused.sh 2021-11-24 14:44:02 +10:00
editing.ftl Simplify NoteEditor by replacing Pane components with Collapsible (#2395) 2023-02-27 16:23:19 +10:00
empty-cards.ftl automatically format/check ftl files 2020-11-22 15:30:59 +10:00
errors.ftl Add Rust bin to deprecate unused ftl entries (#2364) 2023-02-07 11:56:14 +10:00
exporting.ftl Change "unique note identifier" to "unique identifier" 2022-06-11 10:11:29 +10:00
fields.ftl Add option to exclude fields from search (#2394) 2023-03-20 07:46:03 +10:00
findreplace.ftl automatically format/check ftl files 2020-11-22 15:30:59 +10:00
help.ftl Minor wording tweaks to help.ftl; remove an unused entry 2022-10-27 08:24:38 +10:00
importing.ftl Deck scoped dupe check (#2372) 2023-02-16 17:53:36 +10:00
keyboard.ftl Add getPlatformString for making shortcuts to platform string 2021-04-22 13:04:24 +02:00
media-check.ftl Add option to tag notes with missing media (#2379) 2023-02-20 18:48:09 +10:00
media.ftl remove format separator from recording string 2020-12-16 19:44:47 +10:00
network.ftl automatically format/check ftl files 2020-11-22 15:30:59 +10:00
notetypes.ftl Plaintext import/export (#1850) 2022-06-01 20:26:16 +10:00
preferences.ftl Add a button in the preferences to reset window sizes (#2405) 2023-02-28 12:23:34 +10:00
profiles.ftl Backup improvements (#1728) 2022-03-21 19:40:42 +10:00
scheduling.ftl Reset->change in due date prompt 2022-06-01 19:44:51 +10:00
search.ftl search-invalid-flag -> search-invalid-flag-2 2021-06-02 21:49:33 +02:00
statistics.ftl run ftl/remove-unused.sh 2021-11-24 14:44:02 +10:00
studying.ftl Fix bury count (more) (#1712) 2022-03-07 11:03:14 +10:00
sync.ftl tweak sync conflict message 2021-09-08 19:19:23 +10:00
undo.ftl move action names out of undo.ftl into actions.ftl 2021-05-08 17:11:54 +10:00