@@ -0,0 +1,1505 @@
+package edu.neu.ccs.pyramid.experiment;%0A%0Aimport edu.neu.ccs.pyramid.data_formatter.ohsumed.IndexBuilder;%0A%0Aimport edu.neu.ccs.pyramid.util.DirWalker;%0Aimport org.elasticsearch.action.index.IndexResponse;%0Aimport org.elasticsearch.client.Client;%0Aimport org.elasticsearch.common.logging.ESLoggerFactory;%0Aimport org.elasticsearch.common.logging.log4j.Log4jESLoggerFactory;%0Aimport org.elasticsearch.common.xcontent.XContentBuilder;%0Aimport org.elasticsearch.node.Node;%0A%0Aimport java.io.File;%0Aimport java.io.FileReader;%0Aimport java.util.List;%0A%0Aimport static org.elasticsearch.node.NodeBuilder.nodeBuilder;%0A%0A/**%0A * index Ohsumed_20000 on fiji%0A * Created by chengli on 10/1/14.%0A */%0Apublic class Exp8 %7B%0A    public static void main(String%5B%5D args) throws Exception%7B%0A        String dir  = %22/huge1/people/chengli/Datasets/Ohsumed/original/ohsumed-first-20000-docs%22;%0A%0A        Node node = nodeBuilder().client(true).clusterName(%22fijielasticsearch%22).node();%0A        Client client = node.client();%0A%0A        List%3CFile%3E list = DirWalker.getFiles(dir);%0A        int id = 0;%0A        for (File file: list)%7B%0A            System.out.println(%22id = %22+id);%0A            XContentBuilder builder = IndexBuilder.getBuilder(file);%0A//            System.out.println(builder.string());%0A            IndexResponse response = client.prepareIndex(%22ohsumed_20000%22, %22document%22,%22%22+id)%0A                    .setSource(builder)%0A                    .execute()%0A                    .actionGet();%0A            id += 1;%0A        %7D%0A        node.close();%0A    %7D%0A%0A%0A%7D%0A

add Exp8