Skip to content

Commit

Permalink
tika host
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjourne committed Nov 15, 2023
1 parent 230786f commit 7b600c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/tools/converter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Fichier permettant de convertir les fichiers du .odt, pdf à .json """

import os
from os import environ, getenv
import json, collections
from odf import text, teletype
from odf.opendocument import load
Expand Down Expand Up @@ -101,7 +102,7 @@ def pdf2json(path: str, sections: list = []) -> dict:
dict: Keys are sections and value the content read
"""
try:
file_data = parser.from_file(path,"http://tika:9998/")
file_data = parser.from_file(path,f"http://{os.getenv('TIKA_HOST', 'tika')}:9998/")
data = file_data['content']
data = data.replace(u'\xa0', u' ')
data = data.replace(u'\n' , u' ')
Expand Down
2 changes: 2 additions & 0 deletions deployments/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ spec:
env:
- name: ES_HOST
value: elasticsearch-master
- name: TIKA_HOST
value: localhost
- name: "ELASTICSEARCH_USERNAME"
valueFrom:
secretKeyRef:
Expand Down

0 comments on commit 7b600c0

Please sign in to comment.