脚本修改 es查询
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ class GuiDingPriceBatch extends BaseBatch{
|
||||
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||
|
||||
//添加自己库中的人工指导价
|
||||
def prices = CcbCommonUtils.findPersonPrice(city, "2022-06-1", "2022-07-21")
|
||||
def prices = CcbCommonUtils.findPersonPrice(city, "2022-07-22", "2022-08-21")
|
||||
if(prices){
|
||||
def distMap = getDistrictMap(city)
|
||||
def rets = createCityDatas(cityCodeDatas, distCodeMap, distMap, prices)
|
||||
|
||||
+9
-7
@@ -5,6 +5,7 @@ import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.fangjia.script.util.ElasticUtils
|
||||
import com.fangjia.script.util.MongoUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
@@ -25,14 +26,15 @@ class NoHouseDistrictStatBatch extends BaseBatch{
|
||||
public static final DBCollection DIST_STAT_COLL = MongoUtils.getCollectionByName2("fangjia_stat", "district_stat", dbUrl)
|
||||
public static final DBCollection AVERAGER_CONFIG_COLL = MongoUtils.getCollectionByName2("fangjia", "averager_config", dbUrl)
|
||||
|
||||
public static String address = "jdbc:es://http://seawater.es.db.fangjia.com:9200/timezone=UTC&page.size=250&connect.timeout=120s&network.timeout=120s&page.timeout=120s"
|
||||
public static EsDataSource dataSource = new EsDataSource()
|
||||
// public static String address = "jdbc:es://http://seawater.es.db.fangjia.com:9200/timezone=UTC&page.size=250&connect.timeout=120s&network.timeout=120s&page.timeout=120s"
|
||||
public static EsDataSource dataSource = null
|
||||
static {
|
||||
dataSource.setUrl(address)
|
||||
Properties connectionProperties = new Properties()
|
||||
connectionProperties.put("user", "developer")
|
||||
connectionProperties.put("password", "5e8edd851d2fdfbd7415232c67367cc3")
|
||||
dataSource.setProperties(connectionProperties)
|
||||
dataSource = ElasticUtils.getEsDataSource("seawater.es.db.fangjia.com")
|
||||
// dataSource.setUrl(address)
|
||||
// Properties connectionProperties = new Properties()
|
||||
// connectionProperties.put("user", "developer")
|
||||
// connectionProperties.put("password", "5e8edd851d2fdfbd7415232c67367cc3")
|
||||
// dataSource.setProperties(connectionProperties)
|
||||
}
|
||||
|
||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
|
||||
|
||||
+6
-6
@@ -35,12 +35,12 @@ class PaimaiDataSend {
|
||||
def task = new PaimaiDataSend()
|
||||
// task.jdRun()
|
||||
// task.aliZcRun()
|
||||
// task.aliZcRun2()
|
||||
task.aliZcRun2()
|
||||
// task.aliFpRun()
|
||||
// task.rmfysszcRun()
|
||||
// task.checkUrl()
|
||||
|
||||
task.paimaiSendToEs()
|
||||
// task.paimaiSendToEs()
|
||||
}
|
||||
|
||||
|
||||
@@ -197,8 +197,8 @@ class PaimaiDataSend {
|
||||
def aliFpRun(){
|
||||
def index = 0
|
||||
def q = new BasicDBObject()
|
||||
q.put("city","宿迁")
|
||||
q.put("url","https://sf-item.taobao.com/sf_item/631616791778.htm")
|
||||
// q.put("city","宿迁")
|
||||
q.put("url","https://sf-item.taobao.com/sf_item/649014193736.htm")
|
||||
//https://sf-item.taobao.com/sf_item/657131607486.htm
|
||||
// q.put("parser_status", new BasicDBObject('$exists',false))
|
||||
def dbcursor = ali_fp_coll.find(q).batchSize(2000)
|
||||
@@ -263,9 +263,9 @@ class PaimaiDataSend {
|
||||
def aliZcRun2(){
|
||||
def index = 0
|
||||
def q = new BasicDBObject()
|
||||
q.put("city","宿迁")
|
||||
// q.put("city","宿迁")
|
||||
// q.put("region","姑苏")
|
||||
// q.put("url","https://zc-item.taobao.com/auction/670178084823.htm")
|
||||
q.put("url","https://zc-item.taobao.com/auction/672615219601.htm")
|
||||
def dbcursor = ali_zc_coll.find(q).batchSize(1000)
|
||||
for(def d : dbcursor){
|
||||
index++
|
||||
|
||||
Reference in New Issue
Block a user