Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM elasticsearch:7.3.1
RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm
RUN yum install -y https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/ius-release-2-1.el7.ius.noarch.rpm

RUN yum clean all && yum update -y && \
yum install -y \
Expand All @@ -8,6 +8,6 @@ RUN yum clean all && yum update -y && \
python36u-devel \
python36u-pip

WORKDIR /usr/share/elasticsearch/
WORKDIR /usr/share/elasticsearch/text-embeddings/
COPY . /usr/share/elasticsearch/text-embeddings/
RUN python3.6 -m pip install -r /usr/share/elasticsearch/text-embeddings/requirements.txt
RUN python3.6 -m pip install -r /usr/share/elasticsearch/text-embeddings/requirements.txt
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ termcolor==1.1.0
urllib3==1.25.3
Werkzeug==0.15.5
wrapt==1.11.2
flask==1.1.1
12 changes: 12 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@
from elasticsearch.helpers import bulk
import tensorflow.compat.v1 as tf
import tensorflow_hub as hub
from flask import Flask

##### API #####

app = Flask(__name__)

@app.route("/")
def hello():
return "Hello, World!"

##### INDEXING #####

def index_data():
if client.indices.exists(index=INDEX_NAME):
return

print("Creating the 'posts' index.")
client.indices.delete(index=INDEX_NAME, ignore=[404])

Expand Down