Skip to content

Commit

Permalink
Improved (??) Solr query.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav committed Apr 27, 2023
1 parent bde8dbf commit 61fb6d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ async def lookup_curies(
#)
fragments = re.split(not_alpha,string)
filters = [
f"(preferred_name:{fragment} OR names:{fragment})"
# Boost the preferred name by a factor of 10.
# Using names:{fragment}* causes Solr to prioritize some odd results;
# using names:{fragment} OR names:{fragment}* should cause it to still
# include those results while prioritizing complete fragments.
f"(preferred_name:{fragment}^10 OR names:{fragment} OR names:{fragment}*)"
for fragment in fragments if len(fragment) > 0
]
if biolink_type:
Expand Down

0 comments on commit 61fb6d2

Please sign in to comment.