ErwinKomen / RU-wnd

Dutch language dialect dictionaries, Radboud University Nijmegen
0 stars 0 forks source link

e-WLD: Speed up reaction #39

Closed ErwinKomen closed 2 years ago

ErwinKomen commented 6 years ago

Speed-up the reaction on a request from:

  1. Lemma
  2. Trefwoord
  3. Plaats
ErwinKomen commented 6 years ago

I sped up the reaction to LemmaListView in the following way:

  1. Do not include Lower() in the main queryset request (I've made all lemma_gloss fields into lower case)
  2. Split the query into two parts:
    1. Get a list of lemma id's to be excluded (because of aflevering_toonbaar) using a separate query
    2. Make the main query using .exclude(lemma_avoid_list)
    3. Add to settings.py, to the TEMPLATES section: django.template.loaders.cached.Loader
    4. Use list() to force evaluation on a number of places
ErwinKomen commented 6 years ago

I also sped up the reaction of TrefwoordListView, by only using (2.ii) from above.

And I've migrated to django version 1.11

TODO: speed up the reaction of Plaatsen

ErwinKomen commented 6 years ago

Okay, well, speeding up the reaction on "plaatsen" (locations) should perhaps be done in two steps:

  1. The initial reaction to "Plaatsen" should perhaps just be a list of "plaatsen" that satisfy the search criterion (e.g. d* yields 20 hits)
  2. Then the user should 'click through' to get all the entries associated with one particular location. And those entries are to be divided into Lemma's, and paginated accordingly.

That might speed it up enough

ErwinKomen commented 6 years ago
  1. Adapt dialect_list.html to make use of layout.html.
  2. Adapt topnav.html by adding 'topdialectsearch'. This will in the future replace 'toplocationsearch'.
  3. Adapt diadict.js to handle the topdialectsearch correctly
  4. Adapt LemmaListView to use iexact matching rather than iregex, if no regular expression is used
ErwinKomen commented 6 years ago

Also adapted TrefwoordListView and LemmaListView to use iexact matching rather than iregex when it comes to the search part itself. This makes a speed difference.