edraizen / HistoneDB

Browse all histone sequences by histone varaints
http://www.ncbi.nlm.nih.gov/projects/HistoneDB2.0
0 stars 2 forks source link

Search in table problem #126

Closed molsim closed 8 years ago

molsim commented 8 years ago

We have some problems with search in table via the embedded field: 1) Fist of all, if it does not find something it does not say "No matches", it says "Loading, please, wait" 2) The search code in search.py returns internal errors, in this code, which are not caught by except. There are multiple old style variants. Now if I fix it, the search becomes very slow.

    try:
        variant = OldStyleVariant.objects.get(name__icontains=search_text.replace(" ", "_")).updated_variant

        if self.navbar:
            self.redirect = redirect(variant)
        else:
            self.query.format("variant_id", "is", variant.id, str)
        return
    except OldStyleVariant.DoesNotExist: #   changed by Alexey 9/11/2015
    # except:
        pass
edraizen commented 8 years ago

Maybe the "__icontains" is slowing it down? I recently changed that to allow the new variant names with underscores.

molsim commented 8 years ago

Point 1 - fixed - simply javascript error in MSA when no sequences found. will check icontains now

molsim commented 8 years ago

Still a mystery for me, which JS function handles the quick search in table?

molsim commented 8 years ago

Ok, fixed it by not allowing search with one symbol.