Changeset 30974 for other-projects


Ignore:
Timestamp:
2016-10-28T13:47:10+13:00 (7 years ago)
Author:
davidb
Message:

update/add/doc JSON structure needed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/hathitrust/solr-extracted-features/trunk/src/main/java/org/hathitrust/PagedJSON.java

    r30973 r30974  
    9191    protected JSONObject generateSolrDocJSON(String volume_id, String page_id, JSONObject ef_page)
    9292    {
    93         JSONObject solr_add_json = null;
     93        JSONObject solr_update_json = null;
    9494       
    9595        if (ef_page != null) {
     
    9999                if (ef_token_pos_count != null) {
    100100
    101                     solr_add_json = new JSONObject();
     101                    JSONObject solr_add_json = new JSONObject();
    102102
    103103                    String text = generateSolrText(ef_token_pos_count);
    104        
    105                    
    106104                   
    107105                    JSONObject solr_doc_json = new JSONObject();
     
    109107                    solr_doc_json.put("volumeid_s", volume_id);
    110108                    solr_doc_json.put("_text_", text);
    111                     solr_doc_json.put("commitWithin", 5000);
    112109                   
    113                     solr_add_json.put("add", solr_doc_json);
     110                    solr_add_json.put("commitWithin", 5000);
     111                    solr_add_json.put("doc", solr_doc_json);
     112                   
     113                    solr_update_json = new JSONObject();
     114                    solr_update_json.put("add",solr_add_json);
     115                   
    114116                }
    115117                else {
     
    169171       
    170172        //return solr_doc_json;
    171         return solr_add_json;
     173        return solr_update_json;
    172174    }
    173175   
Note: See TracChangeset for help on using the changeset viewer.