Valentin Mayer-Eichberger

16 papers A* 2A 3B 2C 1Journal 6Unranked 2
YearRankTypeTitle / Venue / Authors
2023 J jnl
CoRR
Henrik Stromberg, Valentin Mayer-Eichberger, Armin Lohrengel
2023 conf
ACG
Irfansha Shaik, Valentin Mayer-Eichberger, Jaco van de Pol, Abdallah Saffidine
2023 J jnl
CoRR
Irfansha Shaik, Valentin Mayer-Eichberger, Jaco van de Pol, Abdallah Saffidine
2022 A conf
SAT
Jean Christoph Jung, Valentin Mayer-Eichberger, Abdallah Saffidine
2020 J jnl
CoRR
Ignasi Abío, Valentin Mayer-Eichberger, Peter J. Stuckey
2020 A conf
SAT
Valentin Mayer-Eichberger, Abdallah Saffidine
2020 J jnl
CoRR
Valentin Mayer-Eichberger, Abdallah Saffidine
2016 A* conf
IJCAI
Valentin Mayer-Eichberger
2016 B conf
CPAIOR
Ignasi Abío, Graeme Gange, Valentin Mayer-Eichberger, Peter J. Stuckey
2015 A conf
CP
Ignasi Abío, Valentin Mayer-Eichberger, Peter J. Stuckey
2015 A* conf
AAAI
Valentin Mayer-Eichberger
2014 J jnl
CoRR
Ignasi Abío, Robert Nieuwenhuis, Albert Oliveras, Enric Rodríguez-Carbonell, Valentin Mayer-Eichberger
2014 B conf
CPAIOR
Christian Artigues, Emmanuel Hebrard, Valentin Mayer-Eichberger, Mohamed Siala, Toby Walsh
2013 conf
POS@SAT
Valentin Mayer-Eichberger, Toby Walsh
2012 J jnl
J. Artif. Intell. Res.
Ignasi Abío, Robert Nieuwenhuis, Albert Oliveras, Enric Rodríguez-Carbonell, Valentin Mayer-Eichberger
2007 C conf
NeSy
Sebastian Bader, Steffen Hölldobler, Valentin Mayer-Eichberger
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