Rami R. Hagege

30 papers A* 1B 4C 1Misc 3Journal 12Unranked 9
YearRankTypeTitle / Venue / Authors
2020 J jnl
IEEE Trans. Image Process.
Yaniv Tocker, Rami R. Hagege, Joseph M. Francos
2019 B conf
ICIP
Yaniv Tocker, Rami R. Hagege, Joseph M. Francos
2019 J jnl
IEEE Trans. Circuits Syst. Video Technol.
Amir Kolaman, Dan Malowany, Rami R. Hagege, Hugo Guterman
2019 J jnl
CoRR
Erez Posner, Rami R. Hagege
2017 J jnl
IEEE Trans. Image Process.
Ran Sharon, Joseph M. Francos, Rami R. Hagege
2017 J jnl
Image Process. Line
Erez Farhan, Elad Meir, Rami R. Hagege
2016 J jnl
Int. J. Comput. Vis.
Jonathan Hexner, Rami R. Hagege
2016 A* conf
CVPR
Amir Kolaman, Maxim Lvov, Rami R. Hagege, Hugo Guterman
2016 Misc conf
ICASSP
Ran Sharon, Erez Farhan, Rami R. Hagege, Joseph M. Francos
2016 J jnl
IEEE Trans. Inf. Theory
Rami R. Hagege, Joseph M. Francos
2015 Misc conf
ICASSP
Ran Sharon, Rami R. Hagege, Joseph M. Francos
2015 J jnl
SIAM J. Imaging Sci.
Erez Farhan, Rami R. Hagege
2014 conf
SSP
Erez Farhan, Rami R. Hagege
2014 B conf
ICIP
Erez Farhan, Rami R. Hagege
2014 J jnl
Mach. Vis. Appl.
Rami R. Hagege
2013 J jnl
IEEE Trans. Inf. Theory
Rami R. Hagege, Joseph M. Francos
2013 conf
GlobalSIP
Ran Sharon, Joseph M. Francos, Rami R. Hagege
2011 Misc conf
ICASSP
Nadav Geva, Rami R. Hagege, Joseph M. Francos
2011 B conf
ISIT
Rami R. Hagege, Joseph M. Francos
2010 J jnl
IEEE Trans. Pattern Anal. Mach. Intell.
Shahar Z. Kovalsky, Guy Cohen, Rami R. Hagege, Joseph M. Francos
2010 J jnl
J. Math. Imaging Vis.
Rami R. Hagege, Joseph M. Francos
2009 C conf
MMSP
Rami R. Hagege, Joseph M. Francos
2008 conf
ACSCC
Gilad Cohen, Joseph M. Francos, Rami R. Hagege
2008 B conf
ICPR
Gilad Cohen, Joseph M. Francos, Rami R. Hagege
2007 conf
SIP
Rami R. Hagege, Joseph M. Francos
2007 conf
SIP
Rami Shallom, Rami R. Hagege, Joseph M. Francos
2007 conf
SIP
Shahar Z. Kovalsky, Rami R. Hagege, Joseph M. Francos
2006 conf
ICASSP (2)
Rami R. Hagege, Joseph M. Francos
2005 conf
ICASSP (2)
Rami R. Hagege, Joseph M. Francos
2004 conf
ICASSP (3)
Rami R. Hagege, Joseph M. Francos
redb/utils/push_to_elastic.py
← Index redb/utils/push_to_elastic.py python
import json
import os
#from redb.settings import elasticsearch as es
from elasticsearch import Elasticsearch
from dataclasses import asdict
from dotenv import load_dotenv

class Utils():
    """
    Utility class for pushing

    """
    @staticmethod
    def push_to_elastic(sample_dict):
        """
        Pushes the sample_dict to elastic search
        """
        load_dotenv()
        ELASTIC_ENDPOINT = os.getenv("ELASTIC_HOST")
        ELASTIC_ENFORCE_SSL = os.getenv("ELASTIC_ENFORCE_SSL", False) == "True"
        ELASTIC_USER = os.getenv("ELASTIC_USER")
        ELASTIC_PASSWORD = os.getenv("ELASTIC_PASSWORD")
        ELASTIC_BINARIES_COLLECTION = os.getenv(
            "ELASTIC_BINARIES_COLLECTION", "redb_test"
        )
        es = Elasticsearch(
            ELASTIC_ENDPOINT,
            verify_certs=ELASTIC_ENFORCE_SSL,
            basic_auth=(ELASTIC_USER, ELASTIC_PASSWORD),
            maxsize=20,
            retry_on_timeout=True,
            timeout=30,
        )

        try:
            dict_dump = json.dumps(sample_dict)
        except Exception as e:
            print(f"Error: {e}")
            return False
        elastic = es.index(index=ELASTIC_BINARIES_COLLECTION, body=dict_dump)
        return True
    
    def push_to_index(sample_dict, index_name):
        """
        Pushes the sample_dict to elastic search
        """
        load_dotenv()
        ELASTIC_ENDPOINT = os.getenv("ELASTIC_HOST")
        ELASTIC_ENFORCE_SSL = os.getenv("ELASTIC_ENFORCE_SSL", False) == "True"
        ELASTIC_USER = os.getenv("ELASTIC_USER")
        ELASTIC_PASSWORD = os.getenv("ELASTIC_PASSWORD")
        ELASTIC_BINARIES_COLLECTION = index_name
        
        es = Elasticsearch(
            ELASTIC_ENDPOINT,
            verify_certs=ELASTIC_ENFORCE_SSL,
            basic_auth=(ELASTIC_USER, ELASTIC_PASSWORD),
            maxsize=20,
            retry_on_timeout=True,
            timeout=30,
        )

        try:
            dict_dump = json.dumps(sample_dict)
        except Exception as e:
            print(f"Error: {e}")
            return False
        elastic = es.index(index=ELASTIC_BINARIES_COLLECTION, body=dict_dump)
        return True