1多种数据源ID重复问题处理思路:
1.1修改文档ID,将源ID编码进去:
source src1
{
sql_query = SELECT id*10+1, ... FROM table1
...
}
source src2
{
sql_query = SELECT id*10+2, ... FROM table2
...
}
1.2
将数据来源存储为一个属性:
source src1
{
sql_query = SELECT id, 1 AS source_id FROM table1
sql_attr_uint = source_id
...
}
source src2
{
sql_query = SELECT id, 2 AS source_id FROM table2
sql_attr_uint = source_id
...
}
2 sql_field_string 与 sql_attr_string 区别
*字符串(很明显!),但前者仅用于检索,而后者可作为全文本被索引。
*sql_field_string:字符串字段(可全文搜索,可返回原始文本信息) # will be both indexed and stored
sql_attr_string:字符串属性(可返回原始文本信息) #will be stored but will not be indexed