1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-18 09:35:20 +02:00
joplin/ReactNativeClient/lib/services
Shawn Axsom 5eb0417b1a
All: Sort search results by average of multiple criteria, including 'Sort notes by' field setting (#3777)
* Weight search results by most recently updated

As discussed here: https://github.com/laurent22/joplin/pull/3777#issuecomment-696491859
Before this commit, results were rarely sorted by date. Content weights and fuzziness were
determined, and then the first criteria to differ would win in sort order (and user_updated_time
was the last criteria checked).

Now the weight score itself will also include age of user_updated_time, surfacing fresh content.
At the current alpha level, results are weighted logarithmically, prioritizing mostly within the
last 30 days, and especially heavily within the past week.

* Updated unit tests to weight search results by last updated date

* Updated unit test title

* Fixed issue with weighted search engine test, and made it more deterministic using mock date

Date was being calculated only at the start of the test suite. It also wasn't using a set mock date, so the milliseconds between the real search engine calculations and the test calculation caused differences in results

* Added initial Search Engine spec

* Added Search Engine spec to README.md

* Renamed Search Sorting spec per laurent22's mentioned naming

* Revised copy in search sorting spec

Co-authored-by: Laurent <laurent22@users.noreply.github.com>
2020-10-09 21:51:11 +01:00
..
commands All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
contextkey All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
debug Desktop: Optimised sidebar rendering speed 2020-09-24 14:30:20 +01:00
interop All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
keychain All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
plugins Fixing links 2020-10-09 19:27:33 +01:00
ResourceEditWatcher All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
rest All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
searchengine All: Sort search results by average of multiple criteria, including 'Sort notes by' field setting (#3777) 2020-10-09 21:51:11 +01:00
synchronizer All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
AlarmService.ts All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
AlarmServiceDriver.android.ts All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
AlarmServiceDriver.ios.ts All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
AlarmServiceDriverNode.ts All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
back-button.js Tools: Enforce and apply eslint rules prefer-const and no-var 2020-03-13 23:46:14 +00:00
BaseService.ts All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
BooleanExpression.ts All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
CommandService.ts All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
DecryptionWorker.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
EncryptionService.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
EncryptionServiceDriverNode.js
ExternalEditWatcher.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
ItemChangeUtils.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
KeymapService.ts All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
KvStore.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
MigrationService.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
ModelCache.js
NavService.js Tools: Enforce and apply eslint rules prefer-const and no-var 2020-03-13 23:46:14 +00:00
PluginManager.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
report.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
ResourceFetcher.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
ResourceService.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
RevisionService.js All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
SettingUtils.ts All: Add support for application plugins (#3257) 2020-10-09 18:35:46 +01:00
UndoRedoService.ts Mobile: Resolves #2595: Add undo/redo support 2020-06-13 16:20:18 +01:00