Skip to content

Commit

Permalink
Merge pull request #315 from azneto/master
Browse files Browse the repository at this point in the history
updates index to ignore case and the prefix of dbxrefs
  • Loading branch information
azneto authored Jun 19, 2021
2 parents a03aa97 + 0c7f49c commit 326d6f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion machado/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ def search(self):
)

for i in q.split():
result |= sqs.filter(text__contains=i)
result |= sqs.filter(text__icontains=i)

return result
3 changes: 1 addition & 2 deletions machado/search_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ def prepare_text(self, obj):
# DBxRef
feature_dbxref = FeatureDbxref.objects.filter(feature=obj)
for i in feature_dbxref:
term = "{}:{}".format(i.dbxref.db.name, i.dbxref.accession)
keywords.add(term)
keywords.add(i.dbxref.accession)

# GO terms
feature_cvterm = FeatureCvterm.objects.filter(feature=obj)
Expand Down

0 comments on commit 326d6f5

Please sign in to comment.