Rahul Singh Maharjan

15 papers A 1B 4Misc 2Journal 5Unranked 3
YearRankTypeTitle / Venue / Authors
2025 J jnl
CoRR
Rahul Singh Maharjan, Marta Romeo, Angelo Cangelosi
2025 B conf
CogSci
Haodong Xie, Xuena Wang, Rahul Singh Maharjan, Federico Tavella, Angelo Cangelosi
2025 J jnl
IEEE Trans. Affect. Comput.
Rahul Singh Maharjan, Lorenzo Bonicelli, Marta Romeo, Simone Calderara, Angelo Cangelosi, Rita Cucchiara
2025 B conf
IJCNN
Theodor Wulff, Rahul Singh Maharjan, Xinyun Chi, Angelo Cangelosi
2025 J jnl
CoRR
Theodor Wulff, Rahul Singh Maharjan, Xinyun Chi, Angelo Cangelosi
2025 conf
ICSR+AI (3)
Niyati Rawal, Rahul Singh Maharjan, Giacomo Salici, Riccardo Catalini, Marta Romeo, Roberto Bigazzi, Lorenzo Baraldi, Roberto Vezzani, Rita Cucchiara, Angelo Cangelosi
2025 Misc conf
ICASSP
Rahul Singh Maharjan, Niyati Rawal, Marta Romeo, Lorenzo Baraldi, Rita Cucchiara, Angelo Cangelosi
2024 J jnl
CoRR
Haodong Xie, Rahul Singh Maharjan, Federico Tavella, Angelo Cangelosi
2024 conf
HFR
Niyati Rawal, Rahul Singh Maharjan, Marta Romeo, Roberto Bigazzi, Lorenzo Baraldi, Rita Cucchiara, Angelo Cangelosi
2024 A conf
ECAI
Hongbo Zhu, Theodor Wulff, Rahul Singh Maharjan, Jinpei Han, Angelo Cangelosi
2024 J jnl
CoRR
Hongbo Zhu, Theodor Wulff, Rahul Singh Maharjan, Jinpei Han, Angelo Cangelosi
2024 B conf
RO-MAN
Rahul Singh Maharjan, Marta Romeo, Angelo Cangelosi
2023 B conf
IJCNN
Rahul Singh Maharjan, Marta Romeo, Angelo Cangelosi
2022 conf
ACIIW
Rahul Singh Maharjan
2019 Misc conf
MVA
Kamran Javed, Nizam Ud Din, Seho Bae, Rahul Singh Maharjan, Donghwan Seo, Juneho Yi
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