英文:
can we specify different field weights while searching in redisearch?
问题
When we create an index on redisearch, we specify different fields with their weights e.g. title text weight 50 description text weight 25 and as per my understanding these weights determine the ordering of results.
I want to know is there a way to specify fields weights which searching i.e. using FT.SEARCH
I would like to change field weights on runtime i.e. according to the query.
I would like to accomplish something like this
FT.SEARCH idx john description weight 50 title weight 25
See how I have tried to change weights while querying.
英文:
When we create an index on redisearch, we specify different fields with their weights e.g. title text weight 50 description text weight 25 and as per my understanding these weights determine the ordering of results.
I want to know is there a way to specify fields weights which searching i.e. using FT.SEARCH
I would like to change field weights on runtime i.e. according to the query.
I would like to accomplish something like this
FT.SEARCH idx john description weight 50 title weight 25
See how I have tried to change weights while querying.
答案1
得分: 3
你可以使用"query attribute"来指定查询的不同部分的权重。更多详情请参考这里:https://oss.redislabs.com/redisearch/Query_Syntax.html#query_attributes
英文:
You can use query attribute to specify different weight for different parts of the query. Take a look here for more details: https://oss.redislabs.com/redisearch/Query_Syntax.html#query_attributes
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论