-
Notifications
You must be signed in to change notification settings - Fork 0
/
modal.uxf
250 lines (227 loc) · 17.1 KB
/
modal.uxf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<diagram program="umletino" version="15.1"><zoom_level>8</zoom_level><help_text>Space for diagram notes</help_text><element><id>UMLUseCase</id><coordinates><x>1072</x><y>1128</y><w>240</w><h>168</h></coordinates><panel_attributes>最终效果: 搜索结果(条目)列表
bg=blue
fg=green
valign=top
group=group-8</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>1128</x><y>1168</y><w>128</w><h>48</h></coordinates><panel_attributes>条目1
包含搜索文本的段落
和blog链接
group=group-8
fg=white
</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>1128</x><y>1216</y><w>128</w><h>32</h></coordinates><panel_attributes>条目2
group=group-8
fg=white
</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>1128</x><y>1248</y><w>128</w><h>32</h></coordinates><panel_attributes>条目3
group=group-8
fg=white
</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLState</id><coordinates><x>1400</x><y>1176</y><w>144</w><h>40</h></coordinates><panel_attributes>博客页面
--
博客内容...
valign=top
group=group-8
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>1248</x><y>1176</y><w>168</w><h>32</h></coordinates><panel_attributes>lt=->
点击
group=group-8
fg=orange</panel_attributes><additional_attributes>10;20;190;20</additional_attributes></element><element><id>UMLGeneric</id><coordinates><x>880</x><y>1096</y><w>112</w><h>32</h></coordinates><panel_attributes>symbol=component
搜索条目组件
group=group-8
bg=orange</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>1056</x><y>1000</y><w>152</w><h>144</h></coordinates><panel_attributes>lt=->
group=group-8
fg=orange</panel_attributes><additional_attributes>10;10;170;10;170;160</additional_attributes></element><element><id>UMLClass</id><coordinates><x>808</x><y>936</y><w>256</w><h>128</h></coordinates><panel_attributes>// Class Element
fg=red
bg=green
layer=9999
搜索结果条目列表数据
--
-id: Long
-title: String
-headings: String[] //html片段的标题
-description: String
-keywords: String[]
-Link: String //点击跳转的地址, 包含Text Fragment
-html: String //条目显示的html片段: <p>xxxx....</p>
group=group-8</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>984</x><y>1096</y><w>224</w><h>32</h></coordinates><panel_attributes>
group=group-8
fg=orange</panel_attributes><additional_attributes>10;20;260;20</additional_attributes></element><element><id>UMLPackage</id><coordinates><x>216</x><y>256</y><w>120</w><h>40</h></coordinates><panel_attributes>搜索文本
--
bg=orange
xxx...
group=group-6</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLActor</id><coordinates><x>88</x><y>256</y><w>48</w><h>96</h></coordinates><panel_attributes>用户
group=group-6
fg=yellow
</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>120</x><y>264</y><w>112</w><h>32</h></coordinates><panel_attributes>lt=.>
输入
group=group-6
fg=green</panel_attributes><additional_attributes>10;20;120;20</additional_attributes></element><element><id>UMLClass</id><coordinates><x>792</x><y>920</y><w>256</w><h>128</h></coordinates><panel_attributes>// Class Element
lt=.
group=group-8
fg=red</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>800</x><y>928</y><w>256</w><h>128</h></coordinates><panel_attributes>// Class Element
lt=.
group=group-8
fg=red</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLSpecialState</id><coordinates><x>384</x><y>248</y><w>160</w><h>64</h></coordinates><panel_attributes>type=decision
判断搜索模式
是否勾选了某些模式
group=group-6
bg=pink</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>456</x><y>304</y><w>32</w><h>64</h></coordinates><panel_attributes>lt=->
否
group=group-6
fg=orange
</panel_attributes><additional_attributes>10;10;10;60</additional_attributes></element><element><id>UMLState</id><coordinates><x>424</x><y>352</y><w>72</w><h>32</h></coordinates><panel_attributes>按照默认算法
判断搜索模式
group=group-6
bg=white
</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>536</x><y>264</y><w>160</w><h>104</h></coordinates><panel_attributes>lt=->
是
fg=orange
</panel_attributes><additional_attributes>10;20;180;20;180;110</additional_attributes></element><element><id>Relation</id><coordinates><x>488</x><y>352</y><w>136</w><h>32</h></coordinates><panel_attributes>lt=->
fg=orange
</panel_attributes><additional_attributes>10;20;150;20</additional_attributes></element><element><id>UMLUseCase</id><coordinates><x>472</x><y>496</y><w>96</w><h>32</h></coordinates><panel_attributes>标题搜索
group=group-6
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLUseCase</id><coordinates><x>632</x><y>504</y><w>96</w><h>32</h></coordinates><panel_attributes>全文搜索
group=group-6
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>1072</x><y>336</y><w>168</w><h>72</h></coordinates><panel_attributes>用于搜索的tokenObj
--
-tokens: Token[][]
-isFullTextSearch: Bolean
-isHeadingSearch: Bolean
-isKeywordsSearch: Bolean
group=group-1
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLUseCase</id><coordinates><x>296</x><y>496</y><w>96</w><h>32</h></coordinates><panel_attributes>关键字搜索
group=group-6
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>328</x><y>272</y><w>72</w><h>24</h></coordinates><panel_attributes>lt=<-
group=group-6
fg=orange</panel_attributes><additional_attributes>70;10;10;10</additional_attributes></element><element><id>Relation</id><coordinates><x>336</x><y>400</y><w>840</w><h>72</h></coordinates><panel_attributes>lt=-
fg=orange
</panel_attributes><additional_attributes>10;70;1030;70;1030;10</additional_attributes></element><element><id>Relation</id><coordinates><x>512</x><y>448</y><w>24</w><h>64</h></coordinates><panel_attributes>lt=<<<-
group=group-6
fg=orange
</panel_attributes><additional_attributes>10;60;10;10</additional_attributes></element><element><id>Relation</id><coordinates><x>336</x><y>448</y><w>24</w><h>64</h></coordinates><panel_attributes>lt=<<<-
group=group-6
fg=orange
</panel_attributes><additional_attributes>10;60;10;10</additional_attributes></element><element><id>Relation</id><coordinates><x>672</x><y>448</y><w>24</w><h>72</h></coordinates><panel_attributes>lt=<<<-
group=group-6
fg=orange</panel_attributes><additional_attributes>10;70;10;10</additional_attributes></element><element><id>UMLClass</id><coordinates><x>16</x><y>792</y><w>256</w><h>128</h></coordinates><panel_attributes>// Class Element
fg=red
bg=green
layer=9999
被搜索的文章列表数据
--
-id: Long
-title: String
-headings: String[] //html片段的标题
-description: String
-keywords: String[]
-nodeTree: Node //文章主体内容的DOM节点树
group=group-0</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>0</x><y>776</y><w>256</w><h>128</h></coordinates><panel_attributes>// Class Element
lt=.
group=group-0
fg=red</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>8</x><y>784</y><w>256</w><h>128</h></coordinates><panel_attributes>// Class Element
lt=.
group=group-0
fg=red</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>40</x><y>616</y><w>224</w><h>104</h></coordinates><panel_attributes>Node
--
-type: String
-children?: Node[]
-startPos: Number
-endPos: Number
/*当children不是null时,是所有child.fullText的拼接*/
-fullText: String //可视文本,不包含换行符
group=group-0
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>112</x><y>712</y><w>24</w><h>96</h></coordinates><panel_attributes>lt=<<<<<-
group=group-0
fg=orange</panel_attributes><additional_attributes>10;100;10;10</additional_attributes></element><element><id>Relation</id><coordinates><x>256</x><y>616</y><w>440</w><h>256</h></coordinates><panel_attributes>lt=-
fg=orange</panel_attributes><additional_attributes>530;10;140;10;140;300;10;300</additional_attributes></element><element><id>Relation</id><coordinates><x>672</x><y>528</y><w>240</w><h>112</h></coordinates><panel_attributes>lt=-
fg=orange</panel_attributes><additional_attributes>10;120;280;120;280;10</additional_attributes></element><element><id>UMLClass</id><coordinates><x>1288</x><y>352</y><w>224</w><h>40</h></coordinates><panel_attributes>Token
halign=left
/*1、单个单词, 必须是系统中存在的Tag(关键字)*/
/*2、三个单词长度的字符串*/
group=group-1
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>1232</x><y>352</y><w>72</w><h>32</h></coordinates><panel_attributes>lt=<<<<<-
group=group-1
fg=orange
</panel_attributes><additional_attributes>70;20;10;20</additional_attributes></element><element><id>UMLClass</id><coordinates><x>1552</x><y>360</y><w>80</w><h>24</h></coordinates><panel_attributes>/String/
group=group-1
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>1504</x><y>360</y><w>64</w><h>40</h></coordinates><panel_attributes>lt=<-
m1=0..n
group=group-1
fg=orange
</panel_attributes><additional_attributes>60;20;10;20</additional_attributes></element><element><id>UMLState</id><coordinates><x>608</x><y>352</y><w>152</w><h>32</h></coordinates><panel_attributes>搜索文本按
标点符号分隔为TokenSource[]
valign=center
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLState</id><coordinates><x>840</x><y>352</y><w>152</w><h>32</h></coordinates><panel_attributes>TokenSource按Token的标准
分隔为Token[]
valign=center
bg=white
</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>752</x><y>352</y><w>104</w><h>32</h></coordinates><panel_attributes>lt=<-
fg=orange
</panel_attributes><additional_attributes>110;20;10;20</additional_attributes></element><element><id>Relation</id><coordinates><x>984</x><y>352</y><w>104</w><h>32</h></coordinates><panel_attributes>lt=<-
fg=orange
</panel_attributes><additional_attributes>110;20;10;20</additional_attributes></element><element><id>UMLState</id><coordinates><x>1232</x><y>688</y><w>176</w><h>32</h></coordinates><panel_attributes>
合计整个文章的匹配度
type=receiver
halign=left
valign=center
bg=cyan</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>832</x><y>656</y><w>152</w><h>80</h></coordinates><panel_attributes>// Class Element
fg=red
bg=green
layer=9999
初步搜索结果列表
/*一个文章可以对应几个结果*/
--
-id: Long // 文章ID
/*root node的type必须是P*/
-matchedNode: Node</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLState</id><coordinates><x>1024</x><y>688</y><w>176</w><h>32</h></coordinates><panel_attributes>
计算matchedNode的匹配度
type=receiver
halign=left
valign=center
bg=cyan
</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>976</x><y>696</y><w>96</w><h>24</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>100;10;10;10</additional_attributes></element><element><id>Relation</id><coordinates><x>1192</x><y>688</y><w>88</w><h>32</h></coordinates><panel_attributes>lt=<-
fg=orange
</panel_attributes><additional_attributes>90;20;10;20</additional_attributes></element><element><id>Relation</id><coordinates><x>1408</x><y>712</y><w>160</w><h>272</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>10;320;180;320;180;10</additional_attributes></element><element><id>Relation</id><coordinates><x>1056</x><y>960</y><w>232</w><h>24</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>10;10;270;10</additional_attributes></element><element><id>UMLState</id><coordinates><x>808</x><y>504</y><w>168</w><h>32</h></coordinates><panel_attributes>遍历Token, 排除那些Redis中
缓存有搜索结果的Token
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>720</x><y>512</y><w>104</w><h>24</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>110;10;10;10</additional_attributes></element><element><id>UMLClass</id><coordinates><x>832</x><y>832</y><w>152</w><h>48</h></coordinates><panel_attributes>// Class Element
fg=red
bg=green
layer=9999
Map
/*key是Token*/
/*value是matchedNode*/</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLState</id><coordinates><x>1032</x><y>504</y><w>168</w><h>32</h></coordinates><panel_attributes>遍历Token, 筛选;
条件: Token所在的数组length大于1
bg=white</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>728</x><y>848</y><w>120</w><h>24</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>130;10;10;10</additional_attributes></element><element><id>Relation</id><coordinates><x>968</x><y>512</y><w>80</w><h>24</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>80;10;10;10</additional_attributes></element><element><id>Relation</id><coordinates><x>1104</x><y>528</y><w>24</w><h>176</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>10;200;10;10</additional_attributes></element><element><id>Relation</id><coordinates><x>976</x><y>712</y><w>152</w><h>160</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>170;10;170;180;10;180</additional_attributes></element><element><id>UMLState</id><coordinates><x>1440</x><y>688</y><w>176</w><h>32</h></coordinates><panel_attributes>
按Token匹配度对过滤结果排序
type=receiver
halign=left
valign=center
bg=cyan
</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLState</id><coordinates><x>1272</x><y>952</y><w>144</w><h>32</h></coordinates><panel_attributes>把Token渲染成html字符串
生成用于跳转到对应位置的Text FragMent
bg=cyan</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>1400</x><y>696</y><w>88</w><h>24</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>90;10;10;10</additional_attributes></element><element><id>UMLSpecialState</id><coordinates><x>408</x><y>824</y><w>160</w><h>64</h></coordinates><panel_attributes>type=decision
对于确定的文章和token,
查询Redis中是否存在缓存
valign=center
bg=pink
group=group-3</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>560</x><y>840</y><w>192</w><h>32</h></coordinates><panel_attributes>lt=-
是(从cache取结果)
fg=orange
group=group-3</panel_attributes><additional_attributes>220;20;10;20</additional_attributes></element><element><id>Relation</id><coordinates><x>360</x><y>848</y><w>64</w><h>24</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>60;10;10;10</additional_attributes></element><element><id>UMLSpecialState</id><coordinates><x>520</x><y>680</y><w>160</w><h>64</h></coordinates><panel_attributes>type=decision
类型为P的节点的fullText
包含至少一个token的
bg=pink
group=group-3</panel_attributes><additional_attributes></additional_attributes></element><element><id>Relation</id><coordinates><x>480</x><y>704</y><w>56</w><h>136</h></coordinates><panel_attributes>lt=<-
否
fg=orange
group=group-3</panel_attributes><additional_attributes>50;10;10;10;10;150</additional_attributes></element><element><id>Relation</id><coordinates><x>672</x><y>704</y><w>80</w><h>168</h></coordinates><panel_attributes>lt=-
是
fg=orange
group=group-3</panel_attributes><additional_attributes>80;190;50;190;50;10;10;10</additional_attributes></element><element><id>Relation</id><coordinates><x>768</x><y>672</y><w>80</w><h>200</h></coordinates><panel_attributes>lt=<-
fg=orange</panel_attributes><additional_attributes>80;10;10;10;10;230</additional_attributes></element></diagram>