codex 1.6.19__py3-none-any.whl → 1.7.0a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codex might be problematic. Click here for more details.
- codex/db.py +119 -0
- codex/librarian/covers/purge.py +1 -1
- codex/librarian/importer/const.py +7 -1
- codex/librarian/importer/create_fks.py +5 -2
- codex/librarian/importer/importerd.py +17 -12
- codex/librarian/importer/moved.py +44 -13
- codex/librarian/importer/tasks.py +2 -0
- codex/librarian/janitor/cleanup.py +21 -8
- codex/librarian/janitor/integrity.py +369 -0
- codex/librarian/janitor/janitor.py +50 -15
- codex/librarian/janitor/latest_version.py +2 -1
- codex/librarian/janitor/status.py +5 -0
- codex/librarian/janitor/tasks.py +37 -0
- codex/librarian/janitor/update.py +1 -1
- codex/librarian/librariand.py +32 -24
- codex/librarian/search/optimize.py +43 -0
- codex/librarian/search/remove.py +18 -46
- codex/librarian/search/searchd.py +14 -17
- codex/librarian/search/status.py +2 -1
- codex/librarian/search/tasks.py +4 -9
- codex/librarian/search/update.py +223 -301
- codex/librarian/watchdog/observers.py +2 -1
- codex/migrations/0029_comicfts.py +58 -0
- codex/migrations/0030_nocase_collation_day_month_indexes_status_types.py +198 -0
- codex/models/admin.py +15 -6
- codex/models/base.py +9 -0
- codex/models/bookmark.py +3 -3
- codex/models/comic.py +68 -16
- codex/models/functions.py +59 -2
- codex/models/groups.py +6 -1
- codex/models/library.py +1 -3
- codex/models/paths.py +9 -3
- codex/serializers/browser/page.py +2 -0
- codex/settings/settings.py +16 -17
- codex/signals/django_signals.py +4 -10
- codex/startup.py +1 -35
- codex/static_root/assets/{VCheckbox-Cko1sQK-.170726b3b8a1.js → VCheckbox-CWiqcZ7a.3feebd47daab.js} +1 -1
- codex/static_root/assets/VCheckbox-CWiqcZ7a.3feebd47daab.js.br +0 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.3feebd47daab.js.gz +0 -0
- codex/static_root/assets/{VCheckbox-Cko1sQK-.js → VCheckbox-CWiqcZ7a.js} +1 -1
- codex/static_root/assets/VCheckbox-CWiqcZ7a.js.br +0 -0
- codex/static_root/assets/VCheckbox-CWiqcZ7a.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js → VCheckboxBtn-Dk3iB62X.bc66d5351baa.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.bc66d5351baa.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.bc66d5351baa.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-CO3-aqQL.js → VCheckboxBtn-Dk3iB62X.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Dk3iB62X.js.gz +0 -0
- codex/static_root/assets/{VCombobox-Bjp6lffE.js → VCombobox-D1_KU27A.b1d30587a973.js} +1 -1
- codex/static_root/assets/VCombobox-D1_KU27A.b1d30587a973.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.b1d30587a973.js.gz +0 -0
- codex/static_root/assets/{VCombobox-Bjp6lffE.caf59fba486e.js → VCombobox-D1_KU27A.js} +1 -1
- codex/static_root/assets/VCombobox-D1_KU27A.js.br +0 -0
- codex/static_root/assets/VCombobox-D1_KU27A.js.gz +0 -0
- codex/static_root/assets/{VDialog-BkpVGB70.6eea3ca762a5.js → VDialog-GbxvFMMN.594fb3a39ced.js} +1 -1
- codex/static_root/assets/VDialog-GbxvFMMN.594fb3a39ced.js.br +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.594fb3a39ced.js.gz +0 -0
- codex/static_root/assets/{VDialog-BkpVGB70.js → VDialog-GbxvFMMN.js} +1 -1
- codex/static_root/assets/VDialog-GbxvFMMN.js.br +0 -0
- codex/static_root/assets/VDialog-GbxvFMMN.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js → VExpansionPanels-Cywv_bEj.a762e63858e5.js} +1 -1
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.a762e63858e5.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.a762e63858e5.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanels-Ci2-j8XX.js → VExpansionPanels-Cywv_bEj.js} +1 -1
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Cywv_bEj.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-D3Py5BfQ.a4f25edb86d3.js → VRadioGroup-C0etmxpZ.0eb3009a6300.js} +1 -1
- codex/static_root/assets/VRadioGroup-C0etmxpZ.0eb3009a6300.js.br +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.0eb3009a6300.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-D3Py5BfQ.js → VRadioGroup-C0etmxpZ.js} +1 -1
- codex/static_root/assets/VRadioGroup-C0etmxpZ.js.br +0 -0
- codex/static_root/assets/VRadioGroup-C0etmxpZ.js.gz +0 -0
- codex/static_root/assets/{VSelect-DtvZsYZz.e98745d858eb.js → VSelect-txrnRiNJ.a5625760018c.js} +1 -1
- codex/static_root/assets/VSelect-txrnRiNJ.a5625760018c.js.br +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.a5625760018c.js.gz +0 -0
- codex/static_root/assets/{VSelect-DtvZsYZz.js → VSelect-txrnRiNJ.js} +1 -1
- codex/static_root/assets/VSelect-txrnRiNJ.js.br +0 -0
- codex/static_root/assets/VSelect-txrnRiNJ.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-D6kmykQW.1e1fda62ceba.js → VSelectionControl-CY6RmcvW.7e8824224f6c.js} +1 -1
- codex/static_root/assets/VSelectionControl-CY6RmcvW.7e8824224f6c.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.7e8824224f6c.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-D6kmykQW.js → VSelectionControl-CY6RmcvW.js} +1 -1
- codex/static_root/assets/VSelectionControl-CY6RmcvW.js.br +0 -0
- codex/static_root/assets/VSelectionControl-CY6RmcvW.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-UGZWxpF5.360bdefcd215.js → VSlideGroup-DtEQMwY1.6c72325635ed.js} +1 -1
- codex/static_root/assets/VSlideGroup-DtEQMwY1.6c72325635ed.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.6c72325635ed.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-UGZWxpF5.js → VSlideGroup-DtEQMwY1.js} +1 -1
- codex/static_root/assets/VSlideGroup-DtEQMwY1.js.br +0 -0
- codex/static_root/assets/VSlideGroup-DtEQMwY1.js.gz +0 -0
- codex/static_root/assets/{VTable-DXH_yQ0o.1149f56ad566.js → VTable-2af995xo.6c5bf36631b2.js} +1 -1
- codex/static_root/assets/VTable-2af995xo.6c5bf36631b2.js.br +0 -0
- codex/static_root/assets/VTable-2af995xo.6c5bf36631b2.js.gz +0 -0
- codex/static_root/assets/{VTable-DXH_yQ0o.js → VTable-2af995xo.js} +1 -1
- codex/static_root/assets/VTable-2af995xo.js.br +0 -0
- codex/static_root/assets/VTable-2af995xo.js.gz +0 -0
- codex/static_root/assets/{VTextField-Blqy56_L.26d8761e0155.js → VTextField-G6CMj7yO.657a130dd302.js} +1 -1
- codex/static_root/assets/VTextField-G6CMj7yO.657a130dd302.js.br +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.657a130dd302.js.gz +0 -0
- codex/static_root/assets/{VTextField-Blqy56_L.js → VTextField-G6CMj7yO.js} +1 -1
- codex/static_root/assets/VTextField-G6CMj7yO.js.br +0 -0
- codex/static_root/assets/VTextField-G6CMj7yO.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-C8_ovV7e.afbc08414765.js → VWindowItem-CzoGd6Ul.721e5da11ad4.js} +1 -1
- codex/static_root/assets/VWindowItem-CzoGd6Ul.721e5da11ad4.js.br +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.721e5da11ad4.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-C8_ovV7e.js → VWindowItem-CzoGd6Ul.js} +1 -1
- codex/static_root/assets/VWindowItem-CzoGd6Ul.js.br +0 -0
- codex/static_root/assets/VWindowItem-CzoGd6Ul.js.gz +0 -0
- codex/static_root/assets/{admin-DTRn8bBs.d031ea42d8d0.js → admin-CsPAIQeG.5175467148a3.js} +1 -1
- codex/static_root/assets/admin-CsPAIQeG.5175467148a3.js.br +0 -0
- codex/static_root/assets/admin-CsPAIQeG.5175467148a3.js.gz +0 -0
- codex/static_root/assets/{admin-DTRn8bBs.js → admin-CsPAIQeG.js} +1 -1
- codex/static_root/assets/admin-CsPAIQeG.js.br +0 -0
- codex/static_root/assets/admin-CsPAIQeG.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-BaXFOcru.b1a44b05f482.js → admin-drawer-panel-BAT7GA64.73a064628c19.js} +11 -11
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.73a064628c19.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.73a064628c19.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-BaXFOcru.js → admin-drawer-panel-BAT7GA64.js} +11 -11
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BAT7GA64.js.gz +0 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js +1 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js.br +0 -0
- codex/static_root/assets/browser-C18l93yc.923860009ef4.js.gz +0 -0
- codex/static_root/assets/browser-C18l93yc.js +1 -0
- codex/static_root/assets/browser-C18l93yc.js.br +0 -0
- codex/static_root/assets/browser-C18l93yc.js.gz +0 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css +1 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css.br +0 -0
- codex/static_root/assets/browser-DaAqlBYO.708ecf0904bb.css.gz +0 -0
- codex/static_root/assets/browser-DaAqlBYO.css +1 -0
- codex/static_root/assets/browser-DaAqlBYO.css.br +0 -0
- codex/static_root/assets/browser-DaAqlBYO.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js +1 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.0a4e02656a35.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js +1 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BazJdNs9.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css +1 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.111421f51e79.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css +1 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Mlmvz8_4.css.gz +0 -0
- codex/static_root/assets/{confirm-dialog-D3_s2DQy.9dde66036c72.js → confirm-dialog-CbW3hlOp.9dd39b443c31.js} +1 -1
- codex/static_root/assets/confirm-dialog-CbW3hlOp.9dd39b443c31.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.9dd39b443c31.js.gz +0 -0
- codex/static_root/assets/{confirm-dialog-D3_s2DQy.js → confirm-dialog-CbW3hlOp.js} +1 -1
- codex/static_root/assets/confirm-dialog-CbW3hlOp.js.br +0 -0
- codex/static_root/assets/confirm-dialog-CbW3hlOp.js.gz +0 -0
- codex/static_root/assets/{datetime-column-BxC1Li9e.3dc314b3295d.js → datetime-column-uSqKZU37.b157b0743db5.js} +1 -1
- codex/static_root/assets/datetime-column-uSqKZU37.b157b0743db5.js.br +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.b157b0743db5.js.gz +0 -0
- codex/static_root/assets/{datetime-column-BxC1Li9e.js → datetime-column-uSqKZU37.js} +1 -1
- codex/static_root/assets/datetime-column-uSqKZU37.js.br +0 -0
- codex/static_root/assets/datetime-column-uSqKZU37.js.gz +0 -0
- codex/static_root/assets/{filter-Bzk7x841.d0c3b602e62d.js → filter-CBl5KEsB.845a81573c2e.js} +1 -1
- codex/static_root/assets/filter-CBl5KEsB.845a81573c2e.js.br +0 -0
- codex/static_root/assets/filter-CBl5KEsB.845a81573c2e.js.gz +0 -0
- codex/static_root/assets/{filter-Bzk7x841.js → filter-CBl5KEsB.js} +1 -1
- codex/static_root/assets/filter-CBl5KEsB.js.br +0 -0
- codex/static_root/assets/filter-CBl5KEsB.js.gz +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js +1 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js.br +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.ecb6eee2e7a0.js.gz +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js +1 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js.br +0 -0
- codex/static_root/assets/flag-tab-CT8pqM4r.js.gz +0 -0
- codex/static_root/assets/{group-tab-5esH4lwX.a81fdd258117.js → group-tab-BOW9kigw.7e5007596367.js} +1 -1
- codex/static_root/assets/group-tab-BOW9kigw.7e5007596367.js.br +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.7e5007596367.js.gz +0 -0
- codex/static_root/assets/{group-tab-5esH4lwX.js → group-tab-BOW9kigw.js} +1 -1
- codex/static_root/assets/group-tab-BOW9kigw.js.br +0 -0
- codex/static_root/assets/group-tab-BOW9kigw.js.gz +0 -0
- codex/static_root/assets/{http-error-BTOBfcGY.52ced6f28420.js → http-error-C6yuLApo.45cf99eb7a70.js} +1 -1
- codex/static_root/assets/http-error-C6yuLApo.45cf99eb7a70.js.br +4 -0
- codex/static_root/assets/http-error-C6yuLApo.45cf99eb7a70.js.gz +0 -0
- codex/static_root/assets/{http-error-BTOBfcGY.js → http-error-C6yuLApo.js} +1 -1
- codex/static_root/assets/http-error-C6yuLApo.js.br +4 -0
- codex/static_root/assets/http-error-C6yuLApo.js.gz +0 -0
- codex/static_root/assets/{library-tab-DiPEdOF7.ece2d642a9dc.js → library-tab-D3WOtpE0.9af34e6e7235.js} +1 -1
- codex/static_root/assets/library-tab-D3WOtpE0.9af34e6e7235.js.br +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.9af34e6e7235.js.gz +0 -0
- codex/static_root/assets/{library-tab-DiPEdOF7.js → library-tab-D3WOtpE0.js} +1 -1
- codex/static_root/assets/library-tab-D3WOtpE0.js.br +0 -0
- codex/static_root/assets/library-tab-D3WOtpE0.js.gz +0 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js +6 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js.br +0 -0
- codex/static_root/assets/main-CmjU2oTp.6a471f6900e5.js.gz +0 -0
- codex/static_root/assets/main-CmjU2oTp.js +6 -0
- codex/static_root/assets/main-CmjU2oTp.js.br +0 -0
- codex/static_root/assets/main-CmjU2oTp.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js +1 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.6e92d0555cd7.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js +1 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-BH54_5f6.js.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-C45-onwe.4722195bb60b.css → pagination-toolbar-DGrxp2OD.css} +1 -1
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.css.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-C45-onwe.css → pagination-toolbar-DGrxp2OD.f960a624f04f.css} +1 -1
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.f960a624f04f.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-DGrxp2OD.f960a624f04f.css.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-CkIzuyx1.00c354a82e6e.js → pagination-toolbar-JH3Kbffr.451171f7ac33.js} +1 -1
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.451171f7ac33.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.451171f7ac33.js.gz +0 -0
- codex/static_root/assets/{pagination-toolbar-CkIzuyx1.js → pagination-toolbar-JH3Kbffr.js} +1 -1
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-JH3Kbffr.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-BjlRPuf4.0f056fa321b6.js → pdf-doc-BcRNpoaW.882f6e967869.js} +1 -1
- codex/static_root/assets/pdf-doc-BcRNpoaW.882f6e967869.js.br +0 -0
- codex/static_root/assets/pdf-doc-BcRNpoaW.882f6e967869.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-BjlRPuf4.js → pdf-doc-BcRNpoaW.js} +1 -1
- codex/static_root/assets/pdf-doc-BcRNpoaW.js.br +0 -0
- codex/static_root/assets/pdf-doc-BcRNpoaW.js.gz +0 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js +2 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js.br +0 -0
- codex/static_root/assets/reader-DIPRg2VB.900370e097aa.js.gz +0 -0
- codex/static_root/assets/reader-DIPRg2VB.js +2 -0
- codex/static_root/assets/reader-DIPRg2VB.js.br +0 -0
- codex/static_root/assets/reader-DIPRg2VB.js.gz +0 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css +1 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css.br +0 -0
- codex/static_root/assets/reader-DveZZr9x.7b21b9f8f628.css.gz +0 -0
- codex/static_root/assets/reader-DveZZr9x.css +1 -0
- codex/static_root/assets/reader-DveZZr9x.css.br +0 -0
- codex/static_root/assets/reader-DveZZr9x.css.gz +0 -0
- codex/static_root/assets/{relation-chips-CUSatZET.js → relation-chips-3tTlR5QH.71f18bc92adc.js} +1 -1
- codex/static_root/assets/relation-chips-3tTlR5QH.71f18bc92adc.js.br +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.71f18bc92adc.js.gz +0 -0
- codex/static_root/assets/{relation-chips-CUSatZET.a58031ff8141.js → relation-chips-3tTlR5QH.js} +1 -1
- codex/static_root/assets/relation-chips-3tTlR5QH.js.br +0 -0
- codex/static_root/assets/relation-chips-3tTlR5QH.js.gz +0 -0
- codex/static_root/assets/{settings-drawer-BSHTAsJ9.js → settings-drawer-BdyFhA_r.151f4c3061ed.js} +2 -2
- codex/static_root/assets/settings-drawer-BdyFhA_r.151f4c3061ed.js.br +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.151f4c3061ed.js.gz +0 -0
- codex/static_root/assets/{settings-drawer-BSHTAsJ9.1d07ce084fc9.js → settings-drawer-BdyFhA_r.js} +2 -2
- codex/static_root/assets/settings-drawer-BdyFhA_r.js.br +0 -0
- codex/static_root/assets/settings-drawer-BdyFhA_r.js.gz +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js +1 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js.br +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.7557c71b4cfa.js.gz +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js +1 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js.br +0 -0
- codex/static_root/assets/stats-tab-DeKjwvmh.js.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.9b7a71e7fe28.css → stats-tab-DpfGsVX3.1cb66f2649a9.css} +1 -1
- codex/static_root/assets/stats-tab-DpfGsVX3.1cb66f2649a9.css.br +0 -0
- codex/static_root/assets/stats-tab-DpfGsVX3.1cb66f2649a9.css.gz +0 -0
- codex/static_root/assets/{stats-tab-BXGisn5N.css → stats-tab-DpfGsVX3.css} +1 -1
- codex/static_root/assets/stats-tab-DpfGsVX3.css.br +0 -0
- codex/static_root/assets/stats-tab-DpfGsVX3.css.gz +0 -0
- codex/static_root/assets/{task-tab-NORFAa9p.97e07e366ddd.js → task-tab-C8D0qRP_.d4ab174c69a3.js} +1 -1
- codex/static_root/assets/task-tab-C8D0qRP_.d4ab174c69a3.js.br +0 -0
- codex/static_root/assets/task-tab-C8D0qRP_.d4ab174c69a3.js.gz +0 -0
- codex/static_root/assets/{task-tab-NORFAa9p.js → task-tab-C8D0qRP_.js} +1 -1
- codex/static_root/assets/task-tab-C8D0qRP_.js.br +0 -0
- codex/static_root/assets/task-tab-C8D0qRP_.js.gz +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js +1 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js.br +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.8e5c1b9e52b0.js.gz +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js +1 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js.br +0 -0
- codex/static_root/assets/unauthorized-BHgBRF4z.js.gz +0 -0
- codex/static_root/assets/{unauthorized-muDsv-rC.css → unauthorized-BjhIc97q.728511c92cd0.css} +1 -1
- codex/static_root/assets/unauthorized-BjhIc97q.728511c92cd0.css.br +0 -0
- codex/static_root/assets/unauthorized-BjhIc97q.728511c92cd0.css.gz +0 -0
- codex/static_root/assets/{unauthorized-muDsv-rC.2166ec8b3a32.css → unauthorized-BjhIc97q.css} +1 -1
- codex/static_root/assets/unauthorized-BjhIc97q.css.br +0 -0
- codex/static_root/assets/unauthorized-BjhIc97q.css.gz +0 -0
- codex/static_root/assets/{user-tab-CHbyN1EW.e7206db08680.js → user-tab-BU31Z92y.35613c713faf.js} +1 -1
- codex/static_root/assets/user-tab-BU31Z92y.35613c713faf.js.br +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.35613c713faf.js.gz +0 -0
- codex/static_root/assets/{user-tab-CHbyN1EW.js → user-tab-BU31Z92y.js} +1 -1
- codex/static_root/assets/user-tab-BU31Z92y.js.br +0 -0
- codex/static_root/assets/user-tab-BU31Z92y.js.gz +0 -0
- codex/static_root/js/choices-admin.8aa64c911203.json +1 -0
- codex/static_root/js/choices-admin.8aa64c911203.json.br +0 -0
- codex/static_root/js/choices-admin.8aa64c911203.json.gz +0 -0
- codex/static_root/js/choices-admin.json +1 -1
- codex/static_root/js/choices-admin.json.br +0 -0
- codex/static_root/js/choices-admin.json.gz +0 -0
- codex/static_root/manifest.45cb46e19686.json +635 -0
- codex/static_root/manifest.45cb46e19686.json.br +0 -0
- codex/static_root/manifest.45cb46e19686.json.gz +0 -0
- codex/static_root/manifest.json +248 -248
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- codex/status_controller.py +10 -4
- codex/views/admin/tasks.py +46 -40
- codex/views/auth.py +15 -4
- codex/views/browser/annotations.py +94 -51
- codex/views/browser/base.py +1 -2
- codex/views/browser/browser.py +52 -21
- codex/views/browser/cover.py +8 -4
- codex/views/browser/filters/annotations.py +28 -6
- codex/views/browser/filters/search/__init__.py +1 -0
- codex/views/browser/filters/search/aliases.py +81 -0
- codex/views/browser/filters/search/field/__init__.py +1 -0
- codex/views/browser/filters/search/field/column.py +53 -0
- codex/views/browser/filters/search/field/expression.py +177 -0
- codex/views/browser/filters/search/field/filter.py +70 -0
- codex/views/browser/filters/search/field/optimize.py +71 -0
- codex/views/browser/filters/search/field/parse.py +187 -0
- codex/views/browser/filters/search/fts.py +38 -0
- codex/views/browser/filters/search/parse.py +220 -0
- codex/views/browser/order_by.py +8 -2
- codex/views/browser/page_in_bounds.py +88 -0
- codex/views/browser/paginate.py +28 -113
- codex/views/const.py +0 -1
- codex/views/opds/v1/feed.py +2 -1
- codex/views/opds/v2/feed.py +2 -1
- codex/views/opds/v2/links.py +1 -1
- codex/views/reader/books.py +1 -1
- codex/views/reader/page.py +3 -3
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/METADATA +18 -10
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/RECORD +321 -372
- codex/_vendor/__init__.py +0 -0
- codex/_vendor/django_haystack-3.2.1.dist-info/AUTHORS +0 -127
- codex/_vendor/django_haystack-3.2.1.dist-info/INSTALLER +0 -1
- codex/_vendor/django_haystack-3.2.1.dist-info/LICENSE +0 -31
- codex/_vendor/django_haystack-3.2.1.dist-info/METADATA +0 -98
- codex/_vendor/django_haystack-3.2.1.dist-info/RECORD +0 -97
- codex/_vendor/django_haystack-3.2.1.dist-info/REQUESTED +0 -0
- codex/_vendor/django_haystack-3.2.1.dist-info/WHEEL +0 -5
- codex/_vendor/django_haystack-3.2.1.dist-info/top_level.txt +0 -1
- codex/_vendor/haystack/__init__.py +0 -80
- codex/_vendor/haystack/admin.py +0 -163
- codex/_vendor/haystack/apps.py +0 -31
- codex/_vendor/haystack/backends/__init__.py +0 -1109
- codex/_vendor/haystack/backends/elasticsearch2_backend.py +0 -390
- codex/_vendor/haystack/backends/elasticsearch5_backend.py +0 -483
- codex/_vendor/haystack/backends/elasticsearch7_backend.py +0 -586
- codex/_vendor/haystack/backends/elasticsearch_backend.py +0 -1141
- codex/_vendor/haystack/backends/simple_backend.py +0 -132
- codex/_vendor/haystack/backends/solr_backend.py +0 -991
- codex/_vendor/haystack/backends/whoosh_backend.py +0 -1104
- codex/_vendor/haystack/constants.py +0 -57
- codex/_vendor/haystack/exceptions.py +0 -57
- codex/_vendor/haystack/fields.py +0 -562
- codex/_vendor/haystack/forms.py +0 -135
- codex/_vendor/haystack/generic_views.py +0 -141
- codex/_vendor/haystack/indexes.py +0 -548
- codex/_vendor/haystack/inputs.py +0 -169
- codex/_vendor/haystack/management/__init__.py +0 -0
- codex/_vendor/haystack/management/commands/__init__.py +0 -0
- codex/_vendor/haystack/management/commands/build_solr_schema.py +0 -187
- codex/_vendor/haystack/management/commands/clear_index.py +0 -67
- codex/_vendor/haystack/management/commands/haystack_info.py +0 -22
- codex/_vendor/haystack/management/commands/rebuild_index.py +0 -65
- codex/_vendor/haystack/management/commands/update_index.py +0 -438
- codex/_vendor/haystack/manager.py +0 -105
- codex/_vendor/haystack/models.py +0 -257
- codex/_vendor/haystack/panels.py +0 -89
- codex/_vendor/haystack/query.py +0 -771
- codex/_vendor/haystack/routers.py +0 -14
- codex/_vendor/haystack/signals.py +0 -88
- codex/_vendor/haystack/templates/panels/haystack.html +0 -33
- codex/_vendor/haystack/templates/search_configuration/schema.xml +0 -1056
- codex/_vendor/haystack/templates/search_configuration/solrconfig.xml +0 -1446
- codex/_vendor/haystack/templatetags/__init__.py +0 -0
- codex/_vendor/haystack/templatetags/highlight.py +0 -131
- codex/_vendor/haystack/templatetags/more_like_this.py +0 -119
- codex/_vendor/haystack/urls.py +0 -5
- codex/_vendor/haystack/utils/__init__.py +0 -84
- codex/_vendor/haystack/utils/app_loading.py +0 -34
- codex/_vendor/haystack/utils/geo.py +0 -71
- codex/_vendor/haystack/utils/highlighting.py +0 -165
- codex/_vendor/haystack/utils/loading.py +0 -374
- codex/_vendor/haystack/utils/log.py +0 -21
- codex/_vendor/haystack/version.py +0 -16
- codex/_vendor/haystack/views.py +0 -253
- codex/integrity.py +0 -492
- codex/librarian/search/merge.py +0 -86
- codex/librarian/search/version.py +0 -63
- codex/search/__init__.py +0 -1
- codex/search/backend.py +0 -524
- codex/search/backend_search.py +0 -229
- codex/search/engine.py +0 -33
- codex/search/indexes.py +0 -79
- codex/search/query.py +0 -67
- codex/search/writing.py +0 -180
- codex/static_root/assets/VCheckbox-Cko1sQK-.170726b3b8a1.js.br +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.170726b3b8a1.js.gz +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.js.br +0 -0
- codex/static_root/assets/VCheckbox-Cko1sQK-.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.c9b8062fd66f.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-CO3-aqQL.js.gz +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.caf59fba486e.js.br +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.caf59fba486e.js.gz +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.js.br +0 -0
- codex/static_root/assets/VCombobox-Bjp6lffE.js.gz +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.6eea3ca762a5.js.br +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.6eea3ca762a5.js.gz +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.js.br +0 -0
- codex/static_root/assets/VDialog-BkpVGB70.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.9c55db4ef49e.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-Ci2-j8XX.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.a4f25edb86d3.js.br +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.a4f25edb86d3.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.js.br +0 -0
- codex/static_root/assets/VRadioGroup-D3Py5BfQ.js.gz +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.e98745d858eb.js.br +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.e98745d858eb.js.gz +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.js.br +0 -0
- codex/static_root/assets/VSelect-DtvZsYZz.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.1e1fda62ceba.js.br +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.1e1fda62ceba.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.js.br +0 -0
- codex/static_root/assets/VSelectionControl-D6kmykQW.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.360bdefcd215.js.br +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.360bdefcd215.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.js.br +0 -0
- codex/static_root/assets/VSlideGroup-UGZWxpF5.js.gz +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.1149f56ad566.js.br +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.1149f56ad566.js.gz +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.js.br +0 -0
- codex/static_root/assets/VTable-DXH_yQ0o.js.gz +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.26d8761e0155.js.br +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.26d8761e0155.js.gz +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.js.br +0 -0
- codex/static_root/assets/VTextField-Blqy56_L.js.gz +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.afbc08414765.js.br +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.afbc08414765.js.gz +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.js.br +0 -0
- codex/static_root/assets/VWindowItem-C8_ovV7e.js.gz +0 -0
- codex/static_root/assets/admin-DTRn8bBs.d031ea42d8d0.js.br +0 -0
- codex/static_root/assets/admin-DTRn8bBs.d031ea42d8d0.js.gz +0 -0
- codex/static_root/assets/admin-DTRn8bBs.js.br +0 -0
- codex/static_root/assets/admin-DTRn8bBs.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.b1a44b05f482.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.b1a44b05f482.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-BaXFOcru.js.gz +0 -0
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js +0 -1
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js.br +0 -0
- codex/static_root/assets/browser-BBpUyGmz.c1cb9e2d463b.js.gz +0 -0
- codex/static_root/assets/browser-BBpUyGmz.js +0 -1
- codex/static_root/assets/browser-BBpUyGmz.js.br +0 -0
- codex/static_root/assets/browser-BBpUyGmz.js.gz +0 -0
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css +0 -1
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css.br +0 -0
- codex/static_root/assets/browser-Binc3n9H.313722d27ca3.css.gz +0 -0
- codex/static_root/assets/browser-Binc3n9H.css +0 -1
- codex/static_root/assets/browser-Binc3n9H.css.br +0 -0
- codex/static_root/assets/browser-Binc3n9H.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css +0 -1
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.aff2975e31f8.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.css +0 -1
- codex/static_root/assets/change-password-dialog-Cebek1-c.css.br +0 -0
- codex/static_root/assets/change-password-dialog-Cebek1-c.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js +0 -1
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.76ab4a29bb9b.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js +0 -1
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js.br +0 -0
- codex/static_root/assets/change-password-dialog-DlHoLhDF.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.9dde66036c72.js.br +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.9dde66036c72.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.js.br +0 -0
- codex/static_root/assets/confirm-dialog-D3_s2DQy.js.gz +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.3dc314b3295d.js.br +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.3dc314b3295d.js.gz +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.js.br +0 -0
- codex/static_root/assets/datetime-column-BxC1Li9e.js.gz +0 -0
- codex/static_root/assets/filter-Bzk7x841.d0c3b602e62d.js.br +0 -0
- codex/static_root/assets/filter-Bzk7x841.d0c3b602e62d.js.gz +0 -0
- codex/static_root/assets/filter-Bzk7x841.js.br +0 -0
- codex/static_root/assets/filter-Bzk7x841.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js +0 -1
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js.br +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.8f8c297600a6.js.gz +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.js +0 -1
- codex/static_root/assets/flag-tab-C2bI5zq3.js.br +0 -0
- codex/static_root/assets/flag-tab-C2bI5zq3.js.gz +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.a81fdd258117.js.br +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.a81fdd258117.js.gz +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.js.br +0 -0
- codex/static_root/assets/group-tab-5esH4lwX.js.gz +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.52ced6f28420.js.br +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.52ced6f28420.js.gz +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.js.br +0 -0
- codex/static_root/assets/http-error-BTOBfcGY.js.gz +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.ece2d642a9dc.js.br +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.ece2d642a9dc.js.gz +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.js.br +0 -0
- codex/static_root/assets/library-tab-DiPEdOF7.js.gz +0 -0
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js +0 -6
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js.br +0 -0
- codex/static_root/assets/main-BPIPjzsc.66def8991e38.js.gz +0 -0
- codex/static_root/assets/main-BPIPjzsc.js +0 -6
- codex/static_root/assets/main-BPIPjzsc.js.br +0 -0
- codex/static_root/assets/main-BPIPjzsc.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js +0 -1
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.278b9978f36f.js.gz +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js +0 -1
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js.br +0 -0
- codex/static_root/assets/pager-full-pdf-CiyC6Al9.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.4722195bb60b.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.4722195bb60b.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-C45-onwe.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.00c354a82e6e.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.00c354a82e6e.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-CkIzuyx1.js.gz +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.0f056fa321b6.js.br +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.0f056fa321b6.js.gz +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.js.br +0 -0
- codex/static_root/assets/pdf-doc-BjlRPuf4.js.gz +0 -0
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css +0 -1
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css.br +0 -0
- codex/static_root/assets/reader-_stAWL-4.5089e9144795.css.gz +0 -0
- codex/static_root/assets/reader-_stAWL-4.css +0 -1
- codex/static_root/assets/reader-_stAWL-4.css.br +0 -0
- codex/static_root/assets/reader-_stAWL-4.css.gz +0 -0
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js +0 -2
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js.br +0 -0
- codex/static_root/assets/reader-ucxnLi2K.d0fbce0f03c1.js.gz +0 -0
- codex/static_root/assets/reader-ucxnLi2K.js +0 -2
- codex/static_root/assets/reader-ucxnLi2K.js.br +0 -0
- codex/static_root/assets/reader-ucxnLi2K.js.gz +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.a58031ff8141.js.br +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.a58031ff8141.js.gz +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.js.br +0 -0
- codex/static_root/assets/relation-chips-CUSatZET.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.1d07ce084fc9.js.br +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.1d07ce084fc9.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.js.br +0 -0
- codex/static_root/assets/settings-drawer-BSHTAsJ9.js.gz +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.9b7a71e7fe28.css.br +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.9b7a71e7fe28.css.gz +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.css.br +0 -0
- codex/static_root/assets/stats-tab-BXGisn5N.css.gz +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js +0 -1
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js.br +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.0a3de58bf5ee.js.gz +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.js +0 -1
- codex/static_root/assets/stats-tab-DKXVB2Cc.js.br +0 -0
- codex/static_root/assets/stats-tab-DKXVB2Cc.js.gz +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.97e07e366ddd.js.br +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.97e07e366ddd.js.gz +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.js.br +0 -0
- codex/static_root/assets/task-tab-NORFAa9p.js.gz +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js +0 -1
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js.br +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.a234e9403f60.js.gz +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.js +0 -1
- codex/static_root/assets/unauthorized-RHaQZRfr.js.br +0 -0
- codex/static_root/assets/unauthorized-RHaQZRfr.js.gz +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.2166ec8b3a32.css.br +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.2166ec8b3a32.css.gz +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.css.br +0 -0
- codex/static_root/assets/unauthorized-muDsv-rC.css.gz +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.e7206db08680.js.br +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.e7206db08680.js.gz +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.js.br +0 -0
- codex/static_root/assets/user-tab-CHbyN1EW.js.gz +0 -0
- codex/static_root/js/choices-admin.1a20a5648f20.json +0 -1
- codex/static_root/js/choices-admin.1a20a5648f20.json.br +0 -0
- codex/static_root/js/choices-admin.1a20a5648f20.json.gz +0 -0
- codex/static_root/manifest.0fe31a6cb99f.json +0 -635
- codex/static_root/manifest.0fe31a6cb99f.json.br +0 -0
- codex/static_root/manifest.0fe31a6cb99f.json.gz +0 -0
- codex/templates/search/indexes/codex/comic_text.txt +0 -47
- codex/views/browser/filters/search.py +0 -196
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/LICENSE +0 -0
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/WHEEL +0 -0
- {codex-1.6.19.dist-info → codex-1.7.0a0.dist-info}/entry_points.txt +0 -0
|
@@ -1,586 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
import warnings
|
|
3
|
-
|
|
4
|
-
from django.conf import settings
|
|
5
|
-
|
|
6
|
-
from ... import haystack
|
|
7
|
-
from ...haystack.backends import BaseEngine
|
|
8
|
-
from ...haystack.backends.elasticsearch_backend import (
|
|
9
|
-
ElasticsearchSearchBackend,
|
|
10
|
-
ElasticsearchSearchQuery,
|
|
11
|
-
)
|
|
12
|
-
from ...haystack.constants import DEFAULT_OPERATOR, DJANGO_CT, DJANGO_ID, FUZZINESS
|
|
13
|
-
from ...haystack.exceptions import MissingDependency
|
|
14
|
-
from ...haystack.utils import get_identifier, get_model_ct
|
|
15
|
-
|
|
16
|
-
try:
|
|
17
|
-
import elasticsearch
|
|
18
|
-
|
|
19
|
-
if not ((7, 0, 0) <= elasticsearch.__version__ < (8, 0, 0)):
|
|
20
|
-
raise ImportError
|
|
21
|
-
from elasticsearch.helpers import bulk, scan
|
|
22
|
-
except ImportError:
|
|
23
|
-
raise MissingDependency(
|
|
24
|
-
"The 'elasticsearch7' backend requires the \
|
|
25
|
-
installation of 'elasticsearch>=7.0.0,<8.0.0'. \
|
|
26
|
-
Please refer to the documentation."
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
DEFAULT_FIELD_MAPPING = {
|
|
31
|
-
"type": "text",
|
|
32
|
-
"analyzer": "snowball",
|
|
33
|
-
}
|
|
34
|
-
FIELD_MAPPINGS = {
|
|
35
|
-
"edge_ngram": {
|
|
36
|
-
"type": "text",
|
|
37
|
-
"analyzer": "edgengram_analyzer",
|
|
38
|
-
},
|
|
39
|
-
"ngram": {
|
|
40
|
-
"type": "text",
|
|
41
|
-
"analyzer": "ngram_analyzer",
|
|
42
|
-
},
|
|
43
|
-
"date": {"type": "date"},
|
|
44
|
-
"datetime": {"type": "date"},
|
|
45
|
-
"location": {"type": "geo_point"},
|
|
46
|
-
"boolean": {"type": "boolean"},
|
|
47
|
-
"float": {"type": "float"},
|
|
48
|
-
"long": {"type": "long"},
|
|
49
|
-
"integer": {"type": "long"},
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class Elasticsearch7SearchBackend(ElasticsearchSearchBackend):
|
|
54
|
-
# Settings to add an n-gram & edge n-gram analyzer.
|
|
55
|
-
DEFAULT_SETTINGS = {
|
|
56
|
-
"settings": {
|
|
57
|
-
"index": {
|
|
58
|
-
"max_ngram_diff": 2,
|
|
59
|
-
},
|
|
60
|
-
"analysis": {
|
|
61
|
-
"analyzer": {
|
|
62
|
-
"ngram_analyzer": {
|
|
63
|
-
"tokenizer": "standard",
|
|
64
|
-
"filter": [
|
|
65
|
-
"haystack_ngram",
|
|
66
|
-
"lowercase",
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
"edgengram_analyzer": {
|
|
70
|
-
"tokenizer": "standard",
|
|
71
|
-
"filter": [
|
|
72
|
-
"haystack_edgengram",
|
|
73
|
-
"lowercase",
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
"filter": {
|
|
78
|
-
"haystack_ngram": {
|
|
79
|
-
"type": "ngram",
|
|
80
|
-
"min_gram": 3,
|
|
81
|
-
"max_gram": 4,
|
|
82
|
-
},
|
|
83
|
-
"haystack_edgengram": {
|
|
84
|
-
"type": "edge_ngram",
|
|
85
|
-
"min_gram": 2,
|
|
86
|
-
"max_gram": 15,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
def __init__(self, connection_alias, **connection_options):
|
|
94
|
-
super().__init__(connection_alias, **connection_options)
|
|
95
|
-
self.content_field_name = None
|
|
96
|
-
|
|
97
|
-
def _get_doc_type_option(self):
|
|
98
|
-
# ES7 does not support a doc_type option
|
|
99
|
-
return {}
|
|
100
|
-
|
|
101
|
-
def _get_current_mapping(self, field_mapping):
|
|
102
|
-
# ES7 does not support a doc_type option
|
|
103
|
-
return {"properties": field_mapping}
|
|
104
|
-
|
|
105
|
-
def clear(self, models=None, commit=True):
|
|
106
|
-
"""
|
|
107
|
-
Clears the backend of all documents/objects for a collection of models.
|
|
108
|
-
|
|
109
|
-
:param models: List or tuple of models to clear.
|
|
110
|
-
:param commit: Not used.
|
|
111
|
-
"""
|
|
112
|
-
if models is not None:
|
|
113
|
-
assert isinstance(models, (list, tuple))
|
|
114
|
-
|
|
115
|
-
try:
|
|
116
|
-
if models is None:
|
|
117
|
-
self.conn.indices.delete(index=self.index_name, ignore=404)
|
|
118
|
-
self.setup_complete = False
|
|
119
|
-
self.existing_mapping = {}
|
|
120
|
-
self.content_field_name = None
|
|
121
|
-
else:
|
|
122
|
-
models_to_delete = []
|
|
123
|
-
|
|
124
|
-
for model in models:
|
|
125
|
-
models_to_delete.append("%s:%s" % (DJANGO_CT, get_model_ct(model)))
|
|
126
|
-
|
|
127
|
-
# Delete using scroll API
|
|
128
|
-
query = {
|
|
129
|
-
"query": {"query_string": {"query": " OR ".join(models_to_delete)}}
|
|
130
|
-
}
|
|
131
|
-
generator = scan(
|
|
132
|
-
self.conn,
|
|
133
|
-
query=query,
|
|
134
|
-
index=self.index_name,
|
|
135
|
-
)
|
|
136
|
-
actions = (
|
|
137
|
-
{"_op_type": "delete", "_id": doc["_id"]} for doc in generator
|
|
138
|
-
)
|
|
139
|
-
bulk(
|
|
140
|
-
self.conn,
|
|
141
|
-
actions=actions,
|
|
142
|
-
index=self.index_name,
|
|
143
|
-
)
|
|
144
|
-
self.conn.indices.refresh(index=self.index_name)
|
|
145
|
-
|
|
146
|
-
except elasticsearch.TransportError as e:
|
|
147
|
-
if not self.silently_fail:
|
|
148
|
-
raise
|
|
149
|
-
|
|
150
|
-
if models is not None:
|
|
151
|
-
self.log.error(
|
|
152
|
-
"Failed to clear Elasticsearch index of models '%s': %s",
|
|
153
|
-
",".join(models_to_delete),
|
|
154
|
-
e,
|
|
155
|
-
exc_info=True,
|
|
156
|
-
)
|
|
157
|
-
else:
|
|
158
|
-
self.log.error(
|
|
159
|
-
"Failed to clear Elasticsearch index: %s", e, exc_info=True
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
def build_search_kwargs(
|
|
163
|
-
self,
|
|
164
|
-
query_string,
|
|
165
|
-
sort_by=None,
|
|
166
|
-
start_offset=0,
|
|
167
|
-
end_offset=None,
|
|
168
|
-
fields="",
|
|
169
|
-
highlight=False,
|
|
170
|
-
facets=None,
|
|
171
|
-
date_facets=None,
|
|
172
|
-
query_facets=None,
|
|
173
|
-
narrow_queries=None,
|
|
174
|
-
spelling_query=None,
|
|
175
|
-
within=None,
|
|
176
|
-
dwithin=None,
|
|
177
|
-
distance_point=None,
|
|
178
|
-
models=None,
|
|
179
|
-
limit_to_registered_models=None,
|
|
180
|
-
result_class=None,
|
|
181
|
-
**extra_kwargs
|
|
182
|
-
):
|
|
183
|
-
index = haystack.connections[self.connection_alias].get_unified_index()
|
|
184
|
-
content_field = index.document_field
|
|
185
|
-
|
|
186
|
-
if query_string == "*:*":
|
|
187
|
-
kwargs = {"query": {"match_all": {}}}
|
|
188
|
-
else:
|
|
189
|
-
kwargs = {
|
|
190
|
-
"query": {
|
|
191
|
-
"query_string": {
|
|
192
|
-
"default_field": content_field,
|
|
193
|
-
"default_operator": DEFAULT_OPERATOR,
|
|
194
|
-
"query": query_string,
|
|
195
|
-
"analyze_wildcard": True,
|
|
196
|
-
"fuzziness": FUZZINESS,
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
filters = []
|
|
202
|
-
|
|
203
|
-
if fields:
|
|
204
|
-
if isinstance(fields, (list, set)):
|
|
205
|
-
fields = " ".join(fields)
|
|
206
|
-
|
|
207
|
-
kwargs["stored_fields"] = fields
|
|
208
|
-
|
|
209
|
-
if sort_by is not None:
|
|
210
|
-
order_list = []
|
|
211
|
-
for field, direction in sort_by:
|
|
212
|
-
if field == "distance" and distance_point:
|
|
213
|
-
# Do the geo-enabled sort.
|
|
214
|
-
lng, lat = distance_point["point"].coords
|
|
215
|
-
sort_kwargs = {
|
|
216
|
-
"_geo_distance": {
|
|
217
|
-
distance_point["field"]: [lng, lat],
|
|
218
|
-
"order": direction,
|
|
219
|
-
"unit": "km",
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
else:
|
|
223
|
-
if field == "distance":
|
|
224
|
-
warnings.warn(
|
|
225
|
-
"In order to sort by distance, you must call the '.distance(...)' method."
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
# Regular sorting.
|
|
229
|
-
sort_kwargs = {field: {"order": direction}}
|
|
230
|
-
|
|
231
|
-
order_list.append(sort_kwargs)
|
|
232
|
-
|
|
233
|
-
kwargs["sort"] = order_list
|
|
234
|
-
|
|
235
|
-
# From/size offsets don't seem to work right in Elasticsearch's DSL. :/
|
|
236
|
-
# if start_offset is not None:
|
|
237
|
-
# kwargs['from'] = start_offset
|
|
238
|
-
|
|
239
|
-
# if end_offset is not None:
|
|
240
|
-
# kwargs['size'] = end_offset - start_offset
|
|
241
|
-
|
|
242
|
-
if highlight:
|
|
243
|
-
# `highlight` can either be True or a dictionary containing custom parameters
|
|
244
|
-
# which will be passed to the backend and may override our default settings:
|
|
245
|
-
|
|
246
|
-
kwargs["highlight"] = {"fields": {content_field: {}}}
|
|
247
|
-
|
|
248
|
-
if isinstance(highlight, dict):
|
|
249
|
-
kwargs["highlight"].update(highlight)
|
|
250
|
-
|
|
251
|
-
if self.include_spelling:
|
|
252
|
-
kwargs["suggest"] = {
|
|
253
|
-
"suggest": {
|
|
254
|
-
"text": spelling_query or query_string,
|
|
255
|
-
"term": {
|
|
256
|
-
# Using content_field here will result in suggestions of stemmed words.
|
|
257
|
-
"field": "text", # ES7 does not support '_all' field
|
|
258
|
-
},
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
if narrow_queries is None:
|
|
263
|
-
narrow_queries = set()
|
|
264
|
-
|
|
265
|
-
if facets is not None:
|
|
266
|
-
kwargs.setdefault("aggs", {})
|
|
267
|
-
|
|
268
|
-
for facet_fieldname, extra_options in facets.items():
|
|
269
|
-
facet_options = {
|
|
270
|
-
"meta": {"_type": "terms"},
|
|
271
|
-
"terms": {"field": index.get_facet_fieldname(facet_fieldname)},
|
|
272
|
-
}
|
|
273
|
-
if "order" in extra_options:
|
|
274
|
-
facet_options["meta"]["order"] = extra_options.pop("order")
|
|
275
|
-
# Special cases for options applied at the facet level (not the terms level).
|
|
276
|
-
if extra_options.pop("global_scope", False):
|
|
277
|
-
# Renamed "global_scope" since "global" is a python keyword.
|
|
278
|
-
facet_options["global"] = True
|
|
279
|
-
if "facet_filter" in extra_options:
|
|
280
|
-
facet_options["facet_filter"] = extra_options.pop("facet_filter")
|
|
281
|
-
facet_options["terms"].update(extra_options)
|
|
282
|
-
kwargs["aggs"][facet_fieldname] = facet_options
|
|
283
|
-
|
|
284
|
-
if date_facets is not None:
|
|
285
|
-
kwargs.setdefault("aggs", {})
|
|
286
|
-
|
|
287
|
-
for facet_fieldname, value in date_facets.items():
|
|
288
|
-
# Need to detect on gap_by & only add amount if it's more than one.
|
|
289
|
-
interval = value.get("gap_by").lower()
|
|
290
|
-
|
|
291
|
-
# Need to detect on amount (can't be applied on months or years).
|
|
292
|
-
if value.get("gap_amount", 1) != 1 and interval not in (
|
|
293
|
-
"month",
|
|
294
|
-
"year",
|
|
295
|
-
):
|
|
296
|
-
# Just the first character is valid for use.
|
|
297
|
-
interval = "%s%s" % (value["gap_amount"], interval[:1])
|
|
298
|
-
|
|
299
|
-
kwargs["aggs"][facet_fieldname] = {
|
|
300
|
-
"meta": {"_type": "date_histogram"},
|
|
301
|
-
"date_histogram": {"field": facet_fieldname, "interval": interval},
|
|
302
|
-
"aggs": {
|
|
303
|
-
facet_fieldname: {
|
|
304
|
-
"date_range": {
|
|
305
|
-
"field": facet_fieldname,
|
|
306
|
-
"ranges": [
|
|
307
|
-
{
|
|
308
|
-
"from": self._from_python(
|
|
309
|
-
value.get("start_date")
|
|
310
|
-
),
|
|
311
|
-
"to": self._from_python(value.get("end_date")),
|
|
312
|
-
}
|
|
313
|
-
],
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
if query_facets is not None:
|
|
320
|
-
kwargs.setdefault("aggs", {})
|
|
321
|
-
|
|
322
|
-
for facet_fieldname, value in query_facets:
|
|
323
|
-
kwargs["aggs"][facet_fieldname] = {
|
|
324
|
-
"meta": {"_type": "query"},
|
|
325
|
-
"filter": {"query_string": {"query": value}},
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
if limit_to_registered_models is None:
|
|
329
|
-
limit_to_registered_models = getattr(
|
|
330
|
-
settings, "HAYSTACK_LIMIT_TO_REGISTERED_MODELS", True
|
|
331
|
-
)
|
|
332
|
-
|
|
333
|
-
if models and len(models):
|
|
334
|
-
model_choices = sorted(get_model_ct(model) for model in models)
|
|
335
|
-
elif limit_to_registered_models:
|
|
336
|
-
# Using narrow queries, limit the results to only models handled
|
|
337
|
-
# with the current routers.
|
|
338
|
-
model_choices = self.build_models_list()
|
|
339
|
-
else:
|
|
340
|
-
model_choices = []
|
|
341
|
-
|
|
342
|
-
if len(model_choices) > 0:
|
|
343
|
-
filters.append({"terms": {DJANGO_CT: model_choices}})
|
|
344
|
-
|
|
345
|
-
for q in narrow_queries:
|
|
346
|
-
filters.append({"query_string": {"query": q}})
|
|
347
|
-
|
|
348
|
-
if within is not None:
|
|
349
|
-
filters.append(self._build_search_query_within(within))
|
|
350
|
-
|
|
351
|
-
if dwithin is not None:
|
|
352
|
-
filters.append(self._build_search_query_dwithin(dwithin))
|
|
353
|
-
|
|
354
|
-
# if we want to filter, change the query type to bool
|
|
355
|
-
if filters:
|
|
356
|
-
kwargs["query"] = {"bool": {"must": kwargs.pop("query")}}
|
|
357
|
-
if len(filters) == 1:
|
|
358
|
-
kwargs["query"]["bool"]["filter"] = filters[0]
|
|
359
|
-
else:
|
|
360
|
-
kwargs["query"]["bool"]["filter"] = {"bool": {"must": filters}}
|
|
361
|
-
|
|
362
|
-
if extra_kwargs:
|
|
363
|
-
kwargs.update(extra_kwargs)
|
|
364
|
-
|
|
365
|
-
return kwargs
|
|
366
|
-
|
|
367
|
-
def _build_search_query_dwithin(self, dwithin):
|
|
368
|
-
lng, lat = dwithin["point"].coords
|
|
369
|
-
distance = "%(dist).6f%(unit)s" % {"dist": dwithin["distance"].km, "unit": "km"}
|
|
370
|
-
return {
|
|
371
|
-
"geo_distance": {
|
|
372
|
-
"distance": distance,
|
|
373
|
-
dwithin["field"]: {"lat": lat, "lon": lng},
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
def _build_search_query_within(self, within):
|
|
378
|
-
from ...haystack.utils.geo import generate_bounding_box
|
|
379
|
-
|
|
380
|
-
((south, west), (north, east)) = generate_bounding_box(
|
|
381
|
-
within["point_1"], within["point_2"]
|
|
382
|
-
)
|
|
383
|
-
return {
|
|
384
|
-
"geo_bounding_box": {
|
|
385
|
-
within["field"]: {
|
|
386
|
-
"top_left": {"lat": north, "lon": west},
|
|
387
|
-
"bottom_right": {"lat": south, "lon": east},
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
def more_like_this(
|
|
393
|
-
self,
|
|
394
|
-
model_instance,
|
|
395
|
-
additional_query_string=None,
|
|
396
|
-
start_offset=0,
|
|
397
|
-
end_offset=None,
|
|
398
|
-
models=None,
|
|
399
|
-
limit_to_registered_models=None,
|
|
400
|
-
result_class=None,
|
|
401
|
-
**kwargs
|
|
402
|
-
):
|
|
403
|
-
from ...haystack import connections
|
|
404
|
-
|
|
405
|
-
if not self.setup_complete:
|
|
406
|
-
self.setup()
|
|
407
|
-
|
|
408
|
-
# Deferred models will have a different class ("RealClass_Deferred_fieldname")
|
|
409
|
-
# which won't be in our registry:
|
|
410
|
-
model_klass = model_instance._meta.concrete_model
|
|
411
|
-
|
|
412
|
-
index = (
|
|
413
|
-
connections[self.connection_alias]
|
|
414
|
-
.get_unified_index()
|
|
415
|
-
.get_index(model_klass)
|
|
416
|
-
)
|
|
417
|
-
field_name = index.get_content_field()
|
|
418
|
-
params = {}
|
|
419
|
-
|
|
420
|
-
if start_offset is not None:
|
|
421
|
-
params["from_"] = start_offset
|
|
422
|
-
|
|
423
|
-
if end_offset is not None:
|
|
424
|
-
params["size"] = end_offset - start_offset
|
|
425
|
-
|
|
426
|
-
doc_id = get_identifier(model_instance)
|
|
427
|
-
|
|
428
|
-
try:
|
|
429
|
-
# More like this Query
|
|
430
|
-
# https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html
|
|
431
|
-
mlt_query = {
|
|
432
|
-
"query": {
|
|
433
|
-
"more_like_this": {
|
|
434
|
-
"fields": [field_name],
|
|
435
|
-
"like": [
|
|
436
|
-
{
|
|
437
|
-
"_index": self.index_name,
|
|
438
|
-
"_id": doc_id,
|
|
439
|
-
},
|
|
440
|
-
],
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
narrow_queries = []
|
|
446
|
-
|
|
447
|
-
if additional_query_string and additional_query_string != "*:*":
|
|
448
|
-
additional_filter = {"query_string": {"query": additional_query_string}}
|
|
449
|
-
narrow_queries.append(additional_filter)
|
|
450
|
-
|
|
451
|
-
if limit_to_registered_models is None:
|
|
452
|
-
limit_to_registered_models = getattr(
|
|
453
|
-
settings, "HAYSTACK_LIMIT_TO_REGISTERED_MODELS", True
|
|
454
|
-
)
|
|
455
|
-
|
|
456
|
-
if models and len(models):
|
|
457
|
-
model_choices = sorted(get_model_ct(model) for model in models)
|
|
458
|
-
elif limit_to_registered_models:
|
|
459
|
-
# Using narrow queries, limit the results to only models handled
|
|
460
|
-
# with the current routers.
|
|
461
|
-
model_choices = self.build_models_list()
|
|
462
|
-
else:
|
|
463
|
-
model_choices = []
|
|
464
|
-
|
|
465
|
-
if len(model_choices) > 0:
|
|
466
|
-
model_filter = {"terms": {DJANGO_CT: model_choices}}
|
|
467
|
-
narrow_queries.append(model_filter)
|
|
468
|
-
|
|
469
|
-
if len(narrow_queries) > 0:
|
|
470
|
-
mlt_query = {
|
|
471
|
-
"query": {
|
|
472
|
-
"bool": {
|
|
473
|
-
"must": mlt_query["query"],
|
|
474
|
-
"filter": {"bool": {"must": list(narrow_queries)}},
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
raw_results = self.conn.search(
|
|
480
|
-
body=mlt_query, index=self.index_name, _source=True, **params
|
|
481
|
-
)
|
|
482
|
-
except elasticsearch.TransportError as e:
|
|
483
|
-
if not self.silently_fail:
|
|
484
|
-
raise
|
|
485
|
-
|
|
486
|
-
self.log.error(
|
|
487
|
-
"Failed to fetch More Like This from Elasticsearch for document '%s': %s",
|
|
488
|
-
doc_id,
|
|
489
|
-
e,
|
|
490
|
-
exc_info=True,
|
|
491
|
-
)
|
|
492
|
-
raw_results = {}
|
|
493
|
-
|
|
494
|
-
return self._process_results(raw_results, result_class=result_class)
|
|
495
|
-
|
|
496
|
-
def _process_hits(self, raw_results):
|
|
497
|
-
return raw_results.get("hits", {}).get("total", {}).get("value", 0)
|
|
498
|
-
|
|
499
|
-
def _process_results(
|
|
500
|
-
self,
|
|
501
|
-
raw_results,
|
|
502
|
-
highlight=False,
|
|
503
|
-
result_class=None,
|
|
504
|
-
distance_point=None,
|
|
505
|
-
geo_sort=False,
|
|
506
|
-
):
|
|
507
|
-
results = super()._process_results(
|
|
508
|
-
raw_results, highlight, result_class, distance_point, geo_sort
|
|
509
|
-
)
|
|
510
|
-
facets = {}
|
|
511
|
-
if "aggregations" in raw_results:
|
|
512
|
-
facets = {"fields": {}, "dates": {}, "queries": {}}
|
|
513
|
-
|
|
514
|
-
for facet_fieldname, facet_info in raw_results["aggregations"].items():
|
|
515
|
-
facet_type = facet_info["meta"]["_type"]
|
|
516
|
-
if facet_type == "terms":
|
|
517
|
-
facets["fields"][facet_fieldname] = [
|
|
518
|
-
(individual["key"], individual["doc_count"])
|
|
519
|
-
for individual in facet_info["buckets"]
|
|
520
|
-
]
|
|
521
|
-
if "order" in facet_info["meta"]:
|
|
522
|
-
if facet_info["meta"]["order"] == "reverse_count":
|
|
523
|
-
srt = sorted(
|
|
524
|
-
facets["fields"][facet_fieldname], key=lambda x: x[1]
|
|
525
|
-
)
|
|
526
|
-
facets["fields"][facet_fieldname] = srt
|
|
527
|
-
elif facet_type == "date_histogram":
|
|
528
|
-
# Elasticsearch provides UTC timestamps with an extra three
|
|
529
|
-
# decimals of precision, which datetime barfs on.
|
|
530
|
-
facets["dates"][facet_fieldname] = [
|
|
531
|
-
(
|
|
532
|
-
datetime.datetime.utcfromtimestamp(
|
|
533
|
-
individual["key"] / 1000
|
|
534
|
-
),
|
|
535
|
-
individual["doc_count"],
|
|
536
|
-
)
|
|
537
|
-
for individual in facet_info["buckets"]
|
|
538
|
-
]
|
|
539
|
-
elif facet_type == "query":
|
|
540
|
-
facets["queries"][facet_fieldname] = facet_info["doc_count"]
|
|
541
|
-
results["facets"] = facets
|
|
542
|
-
return results
|
|
543
|
-
|
|
544
|
-
def _get_common_mapping(self):
|
|
545
|
-
return {
|
|
546
|
-
DJANGO_CT: {
|
|
547
|
-
"type": "keyword",
|
|
548
|
-
},
|
|
549
|
-
DJANGO_ID: {
|
|
550
|
-
"type": "keyword",
|
|
551
|
-
},
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
def build_schema(self, fields):
|
|
555
|
-
content_field_name = ""
|
|
556
|
-
mapping = self._get_common_mapping()
|
|
557
|
-
|
|
558
|
-
for _, field_class in fields.items():
|
|
559
|
-
field_mapping = FIELD_MAPPINGS.get(
|
|
560
|
-
field_class.field_type, DEFAULT_FIELD_MAPPING
|
|
561
|
-
).copy()
|
|
562
|
-
if field_class.boost != 1.0:
|
|
563
|
-
field_mapping["boost"] = field_class.boost
|
|
564
|
-
|
|
565
|
-
if field_class.document is True:
|
|
566
|
-
content_field_name = field_class.index_fieldname
|
|
567
|
-
|
|
568
|
-
# Do this last to override `text` fields.
|
|
569
|
-
if field_mapping["type"] == "text":
|
|
570
|
-
if field_class.indexed is False or hasattr(field_class, "facet_for"):
|
|
571
|
-
field_mapping["type"] = "keyword"
|
|
572
|
-
del field_mapping["analyzer"]
|
|
573
|
-
|
|
574
|
-
mapping[field_class.index_fieldname] = field_mapping
|
|
575
|
-
|
|
576
|
-
return (content_field_name, mapping)
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
class Elasticsearch7SearchQuery(ElasticsearchSearchQuery):
|
|
580
|
-
def add_field_facet(self, field, **options):
|
|
581
|
-
self.facets[field] = options.copy()
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
class Elasticsearch7SearchEngine(BaseEngine):
|
|
585
|
-
backend = Elasticsearch7SearchBackend
|
|
586
|
-
query = Elasticsearch7SearchQuery
|