|
@@ -599,7 +599,8 @@ func StatTree(id string) (ret *util.BlockStatResult) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func GetDoc(startID, endID, id string, index int, query string, queryTypes map[string]bool, queryMethod, mode int, size int, isBacklink, highlight bool) (blockCount int, dom, parentID, parent2ID, rootID, typ string, eof, scroll bool, boxID, docPath string, isBacklinkExpand bool, err error) {
|
|
|
+func GetDoc(startID, endID, id string, index int, query string, queryTypes map[string]bool, queryMethod, mode int, size int, isBacklink, highlight bool) (
|
|
|
+ blockCount int, dom, parentID, parent2ID, rootID, typ string, eof, scroll bool, boxID, docPath string, isBacklinkExpand bool, keywords []string, err error) {
|
|
|
//os.MkdirAll("pprof", 0755)
|
|
|
//cpuProfile, _ := os.Create("pprof/GetDoc")
|
|
|
//pprof.StartCPUProfile(cpuProfile)
|
|
@@ -800,7 +801,6 @@ func GetDoc(startID, endID, id string, index int, query string, queryTypes map[s
|
|
|
|
|
|
subTree := &parse.Tree{ID: rootID, Root: &ast.Node{Type: ast.NodeDocument}, Marks: tree.Marks}
|
|
|
|
|
|
- var keywords []string
|
|
|
if "" != query && (0 == queryMethod || 1 == queryMethod || 3 == queryMethod) { // 只有关键字、查询语法和正则表达式搜索支持高亮
|
|
|
if 0 == queryMethod {
|
|
|
query = stringQuery(query)
|