elasticsearch-cambium

    1.0.24 • Public • Published

    ---------------------examples-------------------

    import {ElasticSearch} from './index';

    const elastic = new ElasticSearch({elasticUrl:'http:localhost:9200/',index:'my-index'}); const elastic = new ElasticSearch();

    takes 2 arguments - filed name to search, field value elastic.searchByField('name','eeee')

    takes 1 argument - search obj elastic.search({name:'tttt',age:30})

    takes 1 argument - elastic id elastic.getByElasticId('D0ubcnkBf9VPGpJ4_Crj')

    takes 1 argument - object to add to the index elastic.addItem({name:'tttt',age:30});

    takes 1 argument = array of objects to add elastic.addMultipleItems([{name:'rrrr',age:10},{name:'eeee',age:11}])

    takes 1 arguement - elasticsearch ID elastic.deleteByElasticId('8Uv2cXkBf9VPGpJ4Nym1')

    takes 2 arguements - field to search, value - it delete everything that match the query elastic.deleteByField('isPending',false)

    takes 1 argument - delete obj elastic.deleteByMultipleFields({name:'rrrr'})

    takes 2 argument - arrat of fields and value to search elastic.searchByOneOfMultiFields(['name','id'],'dani')

    takes 1 argument - obj to update IMPORTANT - the obj must contain id field elastic.updateItem({name:'shani',age:'33',id:'NdBCg3kBDdZal4ixGLDU'})

    elastic.addItem({name:'moti',age:31}); elastic.addItem({name:'shlomo',age:35}); elastic.addItem({name:'yossi',age:53}); elastic.addItem({name:'dani',age:16}); elastic.addItem({name:'avi',age:444,id:'jhjhjhjhjhj'}); elastic.addItem({name:'avi',age:444,id:'1111111111'}); elastic.addItem({name:'avi',age:777});

    Install

    npm i elasticsearch-cambium

    DownloadsWeekly Downloads

    22

    Version

    1.0.24

    License

    ISC

    Unpacked Size

    326 kB

    Total Files

    26

    Last publish

    Collaborators

    • nkfir
    • maviv