|
@@ -0,0 +1,246 @@
|
|
|
+package sqlmodel
|
|
|
+
|
|
|
+type QueryObjecct struct {
|
|
|
+ // Filtered struct {
|
|
|
+ // Filter *Filter `json:"filter,omitempty"`
|
|
|
+ // Query *Query `json:"query,omitempty"`
|
|
|
+ Bool *BoolObject `json:"bool,omitempty"`
|
|
|
+ // } `json:"filtered,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type Query struct {
|
|
|
+ Bool *BoolObject `json:"bool,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type Filter struct {
|
|
|
+ Bool *BoolObject `json:"bool,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 省市县
|
|
|
+type AreaCityDistrictMust struct {
|
|
|
+ *AreaCityDistrict `json:"terms,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 省市县
|
|
|
+type AreaCityDistrict struct {
|
|
|
+ Area []string `json:"area,omitempty"`
|
|
|
+ City []string `json:"city,omitempty"`
|
|
|
+ District []string `json:"district,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 网站名称
|
|
|
+type SiteMust struct {
|
|
|
+ *Site `json:"terms,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type Site struct {
|
|
|
+ Site []string `json:"site,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type DistrictObject struct {
|
|
|
+ Term struct {
|
|
|
+ City string `json:"city,omitempty"`
|
|
|
+ District string `json:"district,omitempty"`
|
|
|
+ } `json:"term,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 一级分类、二级分类
|
|
|
+type ToptypeSubtypeMust struct {
|
|
|
+ *ToptypeSubtype `json:"terms,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 一级分类、二级分类
|
|
|
+type ToptypeSubtype struct {
|
|
|
+ Toptype []string `json:"toptype,omitempty"`
|
|
|
+ Subtype []string `json:"subtype,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+//一级公告类型
|
|
|
+//type ScopeclassMust1 struct {
|
|
|
+// *Scopeclass `json:"prefix,omitempty"`
|
|
|
+//}
|
|
|
+
|
|
|
+// 公告类型
|
|
|
+type ScopeclassMust struct {
|
|
|
+ *Scopeclass `json:"terms,omitempty"`
|
|
|
+}
|
|
|
+type Scopeclass struct {
|
|
|
+ Globaltopscopeclass []string `json:"s_topscopeclass,omitempty"`
|
|
|
+ Globalsubscopeclass []string `json:"s_subscopeclass,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type BudgetMust struct {
|
|
|
+ BudgetObj *BudgetObj `json:"range,omitempty"`
|
|
|
+}
|
|
|
+type BudgetObj struct {
|
|
|
+ Budget *BudgetOrBidamount `json:"budget,omitempty"`
|
|
|
+}
|
|
|
+type BidamountMust struct {
|
|
|
+ BidamountObj *BidamountObj `json:"range,omitempty"`
|
|
|
+}
|
|
|
+type BidamountObj struct {
|
|
|
+ Bidamount *BudgetOrBidamount `json:"bidamount,omitempty"`
|
|
|
+}
|
|
|
+type BudgetOrBidamount struct {
|
|
|
+ Gte float64 `json:"gte,omitempty"`
|
|
|
+ Lt float64 `json:"lt,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 时间范围
|
|
|
+type PublishtimeMust struct {
|
|
|
+ PublishtimeObject *PublishtimeObject `json:"range,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 时间范围
|
|
|
+type PublishtimeObject struct {
|
|
|
+ //查询时间
|
|
|
+ Publishtime *Publishtime `json:"publishtime,omitempty"`
|
|
|
+ Publishtime1 *Publishtime1 `json:"publishtime1,omitempty"`
|
|
|
+ Publishtime2 *Publishtime2 `json:"publishtime2,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 查询时间
|
|
|
+type Publishtime struct {
|
|
|
+ Gte int `json:"gte"`
|
|
|
+ Lt int `json:"lt"`
|
|
|
+}
|
|
|
+type Publishtime1 struct {
|
|
|
+ Gte int `json:"gte"`
|
|
|
+}
|
|
|
+type Publishtime2 struct {
|
|
|
+ Lt int `json:"lt"`
|
|
|
+}
|
|
|
+
|
|
|
+type ExpurasingtimeMust struct {
|
|
|
+ ExpurasingtimeObject *ExpurasingtimeObject `json:"range,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 时间范围
|
|
|
+type ExpurasingtimeObject struct {
|
|
|
+ //查询时间
|
|
|
+ Expurasingtime *Expurasingtime `json:"procurementlist.expurasingtime,omitempty"`
|
|
|
+ Expurasingtime1 *Expurasingtime1 `json:"procurementlist.expurasingtime1,omitempty"`
|
|
|
+ Expurasingtime2 *Expurasingtime2 `json:"procurementlist.expurasingtime2,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 查询时间
|
|
|
+type Expurasingtime struct {
|
|
|
+ Gte int `json:"gte"`
|
|
|
+ Lt int `json:"lt"`
|
|
|
+}
|
|
|
+type Expurasingtime1 struct {
|
|
|
+ Gte int `json:"gte"`
|
|
|
+}
|
|
|
+type Expurasingtime2 struct {
|
|
|
+ Lt int `json:"lt"`
|
|
|
+}
|
|
|
+
|
|
|
+// 字段是或否存在
|
|
|
+type ExistfieldsObjectMust struct {
|
|
|
+ ExistfieldsObject *ExistfieldsObject `json:"constant_score,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 字段存在 存在放MustNot,字符串为空忽略
|
|
|
+type ExistfieldsObject struct {
|
|
|
+ Filter struct {
|
|
|
+ Exists struct {
|
|
|
+ Field string `json:"field,omitempty"`
|
|
|
+ } `json:"exists,omitempty"`
|
|
|
+ } `json:"filter,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type ShouldObj struct {
|
|
|
+ MatchPhrase *MatchPhrase `json:"match_phrase,omitempty"`
|
|
|
+ MultiMatch *MultiMatch `json:"multi_match,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 匹配方式
|
|
|
+type MatchPhrase struct {
|
|
|
+ Title string `json:"title,omitempty"`
|
|
|
+ Detail string `json:"detail,omitempty"`
|
|
|
+ Purchasing string `json:"purchasing,omitempty"`
|
|
|
+ Attachments string `json:"attachments,omitempty"`
|
|
|
+ Projectname string `json:"projectname,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type MultiMatch struct {
|
|
|
+ Query string `json:"query,omitempty"`
|
|
|
+ Type string `json:"type,omitempty"`
|
|
|
+ Fields []string `json:"fields,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 匹配方式 采购单位、中标单位 正则匹配
|
|
|
+type Regular struct {
|
|
|
+ Regexp1 *MultiMatch `json:"regexp1,omitempty"`
|
|
|
+ Regexp2 *MultiMatch `json:"regexp2,omitempty"`
|
|
|
+}
|
|
|
+type Regular_Buyer struct {
|
|
|
+ //Buyer string `json:"buyer.mbuyer,omitempty"`
|
|
|
+ Query string `json:"query,omitempty"`
|
|
|
+ Type string `json:"type,omitempty"`
|
|
|
+ Fields []string `json:"fields,omitempty"`
|
|
|
+}
|
|
|
+type Regular_winner struct {
|
|
|
+ //Winner string `json:"s_winner.mwinner,omitempty"`
|
|
|
+ Query string `json:"query,omitempty"`
|
|
|
+ Type string `json:"type,omitempty"`
|
|
|
+ Fields []string `json:"fields,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+/********************************************/
|
|
|
+type BuyerMatch struct {
|
|
|
+ *Buyer `json:"terms,omitempty"`
|
|
|
+}
|
|
|
+type Buyer struct {
|
|
|
+ Buyer []string `json:"buyer,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type WinnerMatch struct {
|
|
|
+ *Winner `json:"terms,omitempty"`
|
|
|
+}
|
|
|
+type Winner struct {
|
|
|
+ Winner []string `json:"s_winner,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+/********************************************/
|
|
|
+
|
|
|
+// 排除词 must_not
|
|
|
+type NotkeyObject struct {
|
|
|
+ MatchPhrase *MatchPhrase `json:"match_phrase,omitempty"`
|
|
|
+ MultiMatch *MultiMatch `json:"multi_match,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 采购单位行业 should
|
|
|
+type BuyerclassObject struct {
|
|
|
+ Terms struct {
|
|
|
+ Buyerclass []string `json:"buyerclass,omitempty"`
|
|
|
+ } `json:"terms,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type TopscopeclassObject struct {
|
|
|
+ Terms struct {
|
|
|
+ Topscopeclass []string `json:"s_topscopeclass,omitempty"`
|
|
|
+ } `json:"terms,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// 公告行业二级 should
|
|
|
+type SubscopeclassObject struct {
|
|
|
+ Terms struct {
|
|
|
+ Subscopeclass []string `json:"s_subscopeclass,omitempty"`
|
|
|
+ } `json:"terms,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+// xf should
|
|
|
+type NewEsObject struct {
|
|
|
+ Bool struct {
|
|
|
+ Must []interface{} `json:"must,omitempty"`
|
|
|
+ MustNot []interface{} `json:"must_not,omitempty"`
|
|
|
+ Should []interface{} `json:"should,omitempty"`
|
|
|
+ } `json:"bool,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+type BoolObject struct {
|
|
|
+ Must []interface{} `json:"must,omitempty"`
|
|
|
+ MustNot []interface{} `json:"must_not,omitempty"`
|
|
|
+ Should []interface{} `json:"should,omitempty"`
|
|
|
+}
|