parse Solr xml files to SolrInputDocument

前端 未结 3 608
离开以前
离开以前 2020-12-21 05:20

If I have individual files in the expected Solr format (having just ONE doc per file):


  
    GB18030TEST<         


        
3条回答
  •  既然无缘
    2020-12-21 06:11

    EDIT: In order to convert XML to POJO, please reference this previous SO Question - Is there a library to convert Java POJOs to and from JSON and XML?

    Since you already have your documents in the expected format, you can just use the post.jar or post.sh script file as shown in the Solr Tutorial - Indexing Data that both accept xml files as input.

    Also, there is a toSolrInputDocument() method in the SolrJ ClientUtils library that may be useful for you. Granted you would need to marshal the files into the SolrDocument class in order to use the toSolrInputDocument() method.

提交回复
热议问题