我目前正在使用ElasticSearch、Python/Django和Django-Haystack。
我希望根据关键字与最左侧的接近程度来对项目进行排名。
例子
项目是
Jeff is friends with John, Laura and EdwardLaura is friends with Francis, Drake, Jessica and JeffEdward is friends with Laura, Jeff and Jeff
如果 Jeff 是查询,我希望得到以下结果
Jeff is friends with John, Laura and EdwardEdward is friends with Laura, Jeff and JeffLaura is friends with Francis, Drake, Jessica and Jeff
但我明白了:
Edward is friends with Laura, Jeff and JeffJeff is friends with John, Laura and EdwardLaura is friends with Francis, Drake, Jessica and Jeff
有任何想法吗?