zhparserts_headline查询结果中空格被去除了 在匹配的数据记录中,"blogs"."title"字段值为"计算机 网络" 执行sql语句中,highlight_title字段搜索配置如下: ts_headline('zh'::regconfig, "blogs"."title", plainto_tsquery('zh'::regconfig, '计算机'), '') AS "highlight_title", highlight_title字段: 期望返回:"计算机 网络" 实际返回:"计算机网络" (空格没有了)
时间: 2023-06-09 08:04:54 浏览: 43
非常抱歉,我并不是专门为CSDN开发的ChitGPT,我只是一个AI语言模型,无法了解特定的开发项目。关于你的问题,这是因为在ts_headline函数中,第四个参数是设定匹配到关键词后的分隔符,你可以将其设为空格,并在函数最后添加'join'参数进一步避免空格被去除。具体方法可以参考postgresql官方文档中对ts_headline函数的说明。如果你有其他问题,欢迎继续向我提问。
相关问题
解释一下这段代码:ICellStyle style_Headline = wk.CreateCellStyle();
这段代码是在使用 NPOI 操作 Excel 文件时,创建一个单元格样式对象。首先创建了一个 Workbook 对象 wk,然后调用其 CreateCellStyle 方法创建了一个名为 style_Headline 的单元格样式对象。这个对象可以设置单元格的字体、背景色、边框等样式属性,用于美化 Excel 表格的展示效果。
在Flutter中,如何对树形组件设置样式
在Flutter中,可以使用`Theme`和`TextStyle`来设置树形组件的样式。
首先,在`Theme`中设置`TextTheme`,如下所示:
```dart
Theme(
data: ThemeData(
textTheme: TextTheme(
// 标题样式
headline1: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
// 子标题样式
subtitle1: TextStyle(fontSize: 16, fontWeight: FontWeight.normal),
// 正文样式
bodyText1: TextStyle(fontSize: 14, fontWeight: FontWeight.normal),
),
),
child: MyTreeWidget(),
)
```
然后,在树形组件中使用`Text`组件,并指定对应的样式,如下所示:
```dart
class MyNodeWidget extends StatelessWidget {
final String title;
final String subtitle;
const MyNodeWidget({Key key, this.title, this.subtitle}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title, style: Theme.of(context).textTheme.headline1),
Text(subtitle, style: Theme.of(context).textTheme.subtitle1),
],
);
}
}
```
这样就可以设置树形组件的样式了。需要注意的是,`Text`组件必须放在`Theme`的子树中,才能获取到`Theme`中设置的样式。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)