|
@@ -33,6 +33,14 @@ func Test_save(t *testing.T) {
|
|
//log.Println("保存结果", b, DelById("test", "test", bid.String()))
|
|
//log.Println("保存结果", b, DelById("test", "test", bid.String()))
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func Test_GoQ(t *testing.T) {
|
|
|
|
+ InitElastic("http://192.168.3.18:9800")
|
|
|
|
+ //"$中不支持range查询"
|
|
|
|
+ //res := GetPage("bidding", "bidding", `{"$or":[{"TERM_toptype":"拟建"},{"TERM_toptype":"结果"}],"extracttype":{"$gt":1},"TERM_area": "广东","$and":[{"TERM_area": "广东"}{"TERM_area": "广东"}]}`, `{"id":-1}`, `"title","toptype"`, 0, 50)
|
|
|
|
+ res := GetPage("bidding", "bidding", `{"$or":[{"TERM_toptype":"拟建"},{"TERM_toptype":"结果"}]}`, `{"publishtime":-1}`, `"title","toptype","publishtime"`, 0, 50)
|
|
|
|
+ log.Println(res)
|
|
|
|
+}
|
|
|
|
+
|
|
func Test_get(t *testing.T) {
|
|
func Test_get(t *testing.T) {
|
|
InitElastic("http://192.168.3.14:9800")
|
|
InitElastic("http://192.168.3.14:9800")
|
|
a := make(chan int, 1)
|
|
a := make(chan int, 1)
|