Negotiable Paleobotanist Missions

    elasticsearch-sanitize

    2.0.0 • Public • Published

    node-elasticsearch-sanitize

    Circle CI

    npm install --save elasticsearch-sanitize

    Accepts an arbitrary string as input and escapes the ElasticSearch reserved characters:

    + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ / AND OR NOT space
    

    Returns a sanitized string which can be safely used in an ElasticSearch query_string query.

    Usage

    To use pass in a string:

    var myString = "AND there! are? (lots of) char*cters 2 ^escape!"
    console.log(escapeElastic(myString))
    

    And it will return:

    \A\N\D\ there\!\ are\?\ \(lots\ of\)\ char\*cters\ 2\ \^escape\!
    

    Install

    npm i elasticsearch-sanitize

    DownloadsWeekly Downloads

    5,322

    Version

    2.0.0

    License

    MIT

    Last publish

    Collaborators

    • anasqburst
    • jyothis-qb
    • qburst-pratyush
    • cdrohithmqb
    • arunks_qburst
    • sudheeshqburst
    • davoodul
    • athul-qburst
    • mable-liza-mathew
    • sowmyab
    • anoop-kuttikkattu
    • munisa
    • dheerajds
    • arjunqb
    • ashishqburst
    • lanetix-system
    • manu-kodiyan-winmore
    • dnm-winmore
    • mkdyanugk
    • vigneshk7
    • soumyaarun
    • aswanth
    • sajith.qb
    • dhiluraj-qburst
    • anandqb
    • arun-dtk
    • vikasqb
    • acpradosh1234