public static void autoCompleteFund() { Map<String, String> params = Maps.newHashMap(); EsApi esapi = new EsApi(); Page page = new Page(); page.setIndexname("fund"); page.setTypename("fund"); // page.addMustParam("EQ_title",""); // page.addShouldParams("LK_title","长城"); for (int i = 0; i < 10; i++) { // page.addShouldParams("LK_title_first", "js"); // page.addShouldParams("LK_title_all", "dacheng"); page.addShouldParams("LKF_title", "博时转债A"); // page.addShouldParams("LK_fund_code", "050019"); long s = System.currentTimeMillis(); page = esapi.autoCompleteFund(page); long e = System.currentTimeMillis(); System.out.println(e - s); // System.out.println(page.getResult()); } }
public static void search() { // {"fund_code":"000107", // "id":"2279520", // "title":"富国信用增强AB", // "type":"BOND", // "BUY_FEE_RATE_DESC":"", // "BUY_FEE_DISCOUNT_DESC":"", // "mainGain":"0.00385356", // "last3mon":"0.01845867", // "last1year":"0.166417", // "fee":"0.4", // "discount":"1", // "star_level":"", // "risk_level":"2", // "order_year":"93/224", // "order_year_rate":"0.42", // "order_2year":"99/177", // "order_2year_rate":"0.56", // "order_3year":"", // "order_3year_rate":"", // "subject_name":"", // "subject_index":"", // "best":"1"} // Map<String, String> params = Maps.newHashMap(); EsApi esapi = new EsApi(); Page page = new Page(); page.setIndexname("fund"); page.setTypename("fund"); // Map<String ,String >lists = Maps.newHashMap(); // lists.put("LT_order_3year_rate", "0.25"); // lists.put("LT_order_2year_rate","0.33"); // lists.put("LT_order_year_rate","0.5"); // lists.put("EQ_risk_level","1"); // lists.put("EQ_fee","0"); // lists.put("EQ_star_level","5"); // page.searchAggres = lists; // // search_LT_risk_level=3 // page.addMustParam("LT_risk_level", "3"); //ok // page.addMustParam("EQ_fee", "0"); //ok // page.addMustParam("star_level", "5"); //ok // page.addMustParam("GE_order_3year_rate", "0.5"); //ok // page.addMustParam("GE_order_2year_rate", "0.33"); //ok // page.addMustParam("GE_order_1year_rate", "0.25"); //ok // page.addMustParam("GE_last1year", "0.00"); //ok // page.addMustParam("LE_last1year", "0.05"); //ok // page.addMustParam("EQ_ree", "0"); //ok // page.addMustParam("EQ_risk_level", 2); //ok // page.addMustParam("EQ_star_level", "5"); //ok // page.addMustParam("GE_last1year", 0.05); //ok // page.addMustParam("LE_last1year", "0.1"); //ok // page.addMustParam("LE_order_year_rate", "0.50"); //ok // page.addSort("last1year", page.ASC); // page.addSort("best", page.DESC); // page.addMustParam("LK_title","长城"); // page.addMustParam("LK_type","BO"); // page.addMustParam("EQ_title","长城"); // page.addMustParam("LK_tilet_first", "js"); // page.addMustParam("LK_tilet_all", "C"); // page.addShouldParams("LK_title","长城"); page.addShouldParams("LK_tilet_first", "js"); page.addShouldParams("LK_tilet_all", "js"); // page.addMustParam("EQ_title", "0"); // page.addShouldParams("LK_title","长城"); // page.addShouldParams("LK_fund_code","长城"); page = esapi.search(page); System.out.println(page.getResult()); // String r = new JacksonMapperImpl().toJson(page.terms); // System.out.println("r-->"+r); }