Package com.alimama.mdrill.json

Examples of com.alimama.mdrill.json.JSONObject.keys()


    for(int i=0;i<jsonStr.length();i++)
    {
      SolrInputDocument doc=new SolrInputDocument();
      JSONObject obj=jsonStr.getJSONObject(i);
      Iterator keys = obj.keys();
      while (keys.hasNext()) {
        String key = (String) keys.next();
        doc.addField(key, obj.get(key));
      }
      docs.add(doc);
View Full Code Here


    }
    queryStr = queryStr.trim();
    if (queryStr.startsWith("{") && queryStr.endsWith("}")) {
      JSONArray arr = new JSONArray();
      JSONObject jsonStr = new JSONObject(queryStr.trim());
      Iterator keys = jsonStr.keys();
      while (keys.hasNext()) {
        JSONObject item = new JSONObject();
        String key = (String) keys.next();
        item.put(key, jsonStr.getJSONObject(key));
        arr.put(item);
View Full Code Here

        buff.append(")");
        fqList.add(buff.toString());

      }else{
     
              for  (Iterator iter = obj.keys(); iter.hasNext();) {
               
                  String field = (String)iter.next();
                if(isnothedate&&"thedate".equals(field))
                {
                  continue;
View Full Code Here

        buff.append(")");
       
        fqList.add(buff.toString());
      }else{
     
          for  (Iterator iter = obj.keys(); iter.hasNext();) {
              String key = (String)iter.next();
                         
              JSONObject jsonStr2= obj.getJSONObject(key);
             
              int operate = Integer.parseInt(jsonStr2.getString("operate"));
View Full Code Here

  {
    HashSet<String> hashSet=new HashSet<String>();
    for(int i=0;i<list.length();i++)
    {
      JSONObject item=list.getJSONObject(i);
       Iterator  keys = item.keys();
            while (keys.hasNext()) {
              hashSet.add((String) keys.next());
            }
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.