Socket
Socket
Sign inDemoInstall

solr-xml-to-jsonl

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    solr-xml-to-jsonl

A CLI utility to convert a solr data file to a simple JSONL file


Version published
Weekly downloads
1
Maintainers
1
Install size
3.50 MB
Created
Weekly downloads
 

Readme

Source

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"]}

FAQs

Last updated on 21 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc