|
@@ -12,7 +12,8 @@ import (
|
|
|
|
|
|
var (
|
|
|
pjt_count = 100
|
|
|
- pjt_field = `"_id","area","city","bidamount","firsttime","projectname","s_winner","buyer","buyerclass"`
|
|
|
+ pjt_field = `"_id","jgtime","zbtime","projectname","buyer","buyerclass"`
|
|
|
+ pjt_fields = `"_id","area","city","bidamount","budget","zbtime","jgtime","projectname","projectcode","s_winner","buyer","buyerclass","buyerperson","buyertel","sourceinfourl"`
|
|
|
pjt_sort = `{"firsttime":-1}`
|
|
|
query = `{"query": {"bool": {"must":[%s],"should":[%s],"minimum_should_match": 1}}}`
|
|
|
query_string = `{"constant_score": {"boost": 2,"query": {"match_phrase": {"projectname.pname": {"analyzer": "my_ngram","query": "%s","slop": 6}}}}},{"multi_match": {"query": "%s","fields": ["projectname.pname"],"analyzer": "ik","minimum_should_match": "100%%"}}`
|
|
@@ -22,7 +23,7 @@ var (
|
|
|
highlightStr = `%s: {"fragment_size": %d,"number_of_fragments": 1}`
|
|
|
)
|
|
|
|
|
|
-func ProjectListData(projectName, winner, time string) (data *map[string]interface{}) {
|
|
|
+func ProjectListData(projectName, winner, time string, isDetail bool) (data *map[string]interface{}) {
|
|
|
global.Logger.Info("projectName " + projectName)
|
|
|
global.Logger.Info("winner " + winner)
|
|
|
global.Logger.Info("time " + time)
|
|
@@ -67,7 +68,13 @@ func ProjectListData(projectName, winner, time string) (data *map[string]interfa
|
|
|
Es := db.GetEs()
|
|
|
global.Logger.Info("INDEX " + INDEX)
|
|
|
global.Logger.Info("TYPE " + TYPE)
|
|
|
- repl := GetAllByNgram(Es, INDEX, TYPE, qstr, "", pjt_sort, pjt_field, 0, pjt_count, 0, false)
|
|
|
+ fields := ""
|
|
|
+ if isDetail {
|
|
|
+ fields = pjt_fields
|
|
|
+ } else {
|
|
|
+ fields = pjt_field
|
|
|
+ }
|
|
|
+ repl := GetAllByNgram(Es, INDEX, TYPE, qstr, "", pjt_sort, fields, 0, pjt_count, 0, false)
|
|
|
if repl != nil && len(*repl) > 0 {
|
|
|
(*data)["data"] = repl
|
|
|
}
|