Hupass の講義検索を Elasticsearch にしたい | su8ru
カラムごとに優先度を付けてスコアリング
# 関連度でスコア付け
...
Case(
When(subject__contains=term, then=Value(1000)),
When(theme__contains=term, then=Value(500)),
When(elig_dep__contains=term, then=Value(100)),
When(sort__name__contains=term, then=Value(100)),
When(teacher__name__contains=term, then=Value(100)),
When(pk__in=keywords_id, then=Value(10)),
default=Value(0),
)
for term in terms