mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
最多匹配件数检查修改
This commit is contained in:
parent
05cd92ab4e
commit
286be910e1
@ -2,6 +2,7 @@ package ldb
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"glc/com"
|
"glc/com"
|
||||||
|
"glc/conf"
|
||||||
"glc/ldb/search"
|
"glc/ldb/search"
|
||||||
"glc/ldb/storage"
|
"glc/ldb/storage"
|
||||||
"glc/ldb/storage/indexword"
|
"glc/ldb/storage/indexword"
|
||||||
@ -74,13 +75,24 @@ func (e *Engine) Search(searchKey string, system string, minDatetime string, max
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var rs *search.SearchResult
|
||||||
if len(kws) == 0 {
|
if len(kws) == 0 {
|
||||||
// 无条件浏览模式
|
// 无条件浏览模式
|
||||||
return search.SearchLogData(e.storeName, currentDocId, forward, minDatetime, maxDatetime)
|
rs = search.SearchLogData(e.storeName, currentDocId, forward, minDatetime, maxDatetime)
|
||||||
|
} else {
|
||||||
|
// 多关键词查询模式
|
||||||
|
rs = search.SearchWordIndex(e.storeName, kws, currentDocId, forward, minDatetime, maxDatetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多关键词查询模式
|
if !forward {
|
||||||
return search.SearchWordIndex(e.storeName, kws, currentDocId, forward, minDatetime, maxDatetime)
|
// 修复最多匹配件数:检索(非检索更多)数据量少于1页时,最多匹配件数=检索结果件数,避免个别特殊场景下两者不一致
|
||||||
|
size := len(rs.Data)
|
||||||
|
if size < conf.GetPageSize() {
|
||||||
|
rs.Count = cmn.IntToString(size)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rs
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加日志
|
// 添加日志
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user