1.1.1 • Published 9 months ago

solr-xml-to-jsonl v1.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

solr-xml-to-jsonl

This is a simple CLI utility to convert data in SOLR XML format to a JSONL file.

Usage:

npx solr-xml-to-jsonl <path/to/input_solr_data.xml> <path/to/output.jsonl>

This is the expected format of input_solr_data.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<add>
    <docs>
        <doc>
            <field name="product_name">Water Bottle</field>
            <field name="price">1.99</field>
            <field name="description">A bottle of water</field>
            <field name="in_stock">true</field>
            <field name="category">Water</field>
            <field name="category">Bottles</field>
        </doc>
        <doc>
            <field name="product_name">Lemonade</field>
            <field name="price">2.99</field>
            <field name="description">A bottle of lemonade</field>
            <field name="in_stock">true</field>
            <field name="category">Lemonade</field>
            <field name="category">Bottles</field>
        </doc>
    </docs>
</add>

After running this command, the output JSONL will be in this format:

{"product_name":"Water Bottle","price":1.99,"description":"A bottle of water","in_stock":true,"category":["Water","Bottles"]}
{"product_name":"Lemonade","price":2.99,"description":"A bottle of lemonade","in_stock":true,"category":["Lemonade","Bottles"]}
1.1.1

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago