【发布时间】:2015-01-25 16:23:26
【问题描述】:
Mysql 查询:内部查询返回所有包含“man”的attribute_value 及其在attribute 值中的位置。外部查询按位置编号的降序对其进行排序。从而按照“人”开始从第一个位置移动到后面的位置的顺序给出结果喜欢
man
manager
aman
human
hanuman
assistant manager
indian institute of management
这是 SQL 查询:
SELECT f1.av
FROM (
SELECT `attribute_value` av, LOCATE("man",LOWER(`attribute_value`)) po
FROM db_attributes WHERE `attribute_value` LIKE "%man%"
) f1
ORDER BY f1.po
我想使用 solr 来实现这一点。现在我对如何实现这一点一无所知。 Solr 加载了所有属性值。非常感谢您的帮助。
【问题讨论】:
-
Solr 加载了所有属性值是什么意思?请告诉更多细节,显示你的 schema.xml
-
attribute_value是示例中的字段名称。