main
HuangHai 1 month ago
parent 36e292e76f
commit 7268388dfa

@ -1,16 +1,12 @@
'''
conda activate rag
pip install elasticsearch
'''
from elasticsearch import Elasticsearch from elasticsearch import Elasticsearch
import ssl import ssl
import warnings import warnings
from urllib3.exceptions import InsecureRequestWarning from urllib3.exceptions import InsecureRequestWarning
warnings.simplefilter("once", InsecureRequestWarning) # Suppress only the single InsecureRequestWarning from urllib3
warnings.simplefilter("once", DeprecationWarning) warnings.filterwarnings('ignore', category=InsecureRequestWarning)
warnings.simplefilter("once", category=UserWarning) warnings.filterwarnings('once', category=DeprecationWarning)
warnings.filterwarnings('once', category=UserWarning)
context = ssl.create_default_context() context = ssl.create_default_context()
context.check_hostname = False context.check_hostname = False
@ -20,7 +16,8 @@ es = Elasticsearch(
hosts="https://10.10.14.206:9200", hosts="https://10.10.14.206:9200",
basic_auth=("elastic", "jv9h8uwRrRxmDi1dq6u8"), basic_auth=("elastic", "jv9h8uwRrRxmDi1dq6u8"),
ssl_context=context, ssl_context=context,
verify_certs=False verify_certs=False,
ssl_show_warn=False # This will suppress the Elasticsearch warning
) )
try: try:

Loading…
Cancel
Save