|
@@ -307,6 +307,9 @@ func getDataExportSql(scd *SieveCondition) string {
|
|
if v.Keyword != "" {
|
|
if v.Keyword != "" {
|
|
if strings.Contains(v.Keyword, "+") {
|
|
if strings.Contains(v.Keyword, "+") {
|
|
for _, vk := range strings.Split(v.Keyword, "+") {
|
|
for _, vk := range strings.Split(v.Keyword, "+") {
|
|
|
|
+ if len(vk) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|
|
@@ -318,6 +321,9 @@ func getDataExportSql(scd *SieveCondition) string {
|
|
}
|
|
}
|
|
} else if strings.Contains(v.Keyword, " ") {
|
|
} else if strings.Contains(v.Keyword, " ") {
|
|
for _, vk := range strings.Split(v.Keyword, " ") {
|
|
for _, vk := range strings.Split(v.Keyword, " ") {
|
|
|
|
+ if len(vk) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|
|
@@ -348,6 +354,9 @@ func getDataExportSql(scd *SieveCondition) string {
|
|
// 附加词处理分词
|
|
// 附加词处理分词
|
|
if strings.Contains(vv, "+") {
|
|
if strings.Contains(vv, "+") {
|
|
for _, vk := range strings.Split(vv, "+") {
|
|
for _, vk := range strings.Split(vv, "+") {
|
|
|
|
+ if len(vk) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|
|
@@ -359,6 +368,10 @@ func getDataExportSql(scd *SieveCondition) string {
|
|
}
|
|
}
|
|
} else if strings.Contains(vv, " ") {
|
|
} else if strings.Contains(vv, " ") {
|
|
for _, vk := range strings.Split(vv, " ") {
|
|
for _, vk := range strings.Split(vv, " ") {
|
|
|
|
+ if len(vk) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|
|
@@ -382,6 +395,9 @@ func getDataExportSql(scd *SieveCondition) string {
|
|
continue
|
|
continue
|
|
} // 处理每组里面的空格分词
|
|
} // 处理每组里面的空格分词
|
|
for _, notKeySplit := range strings.Split(vv, " ") {
|
|
for _, notKeySplit := range strings.Split(vv, " ") {
|
|
|
|
+ if len(notKeySplit) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail 搜索的时候加上标题
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(notKeySplit))) == 1 {
|
|
if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(notKeySplit))) == 1 {
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|
|
queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
|