Skip to content
This repository was archived by the owner on Dec 25, 2022. It is now read-only.

Commit df8cd99

Browse files
Changed dependency to elasticsarch 6 (#46)
* changed dependency to elasticsarch 6 * added docker environment * implemented prototype of BM25 algorithm * improved docker start * added calculation of avarage field length
1 parent 9233319 commit df8cd99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+246
-246
lines changed

.env.dist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# MySQL
2+
MYSQL_ROOT_PASSWORD=root
3+
MYSQL_DATABASE=mydb
4+
MYSQL_USER=user
5+
MYSQL_PASSWORD=userpass
6+
7+
# Open Ports
8+
PORT_MYSQL=13306
9+
PORT_ELASTICSEARCH=19200
10+
PORT_KIBANA=15601

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ composer.lock
88

99
# testsuite
1010
tests/var
11+
12+
# docker
13+
.env
14+
docker/data/*
15+
!docker/data/.gitkeep

.travis.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
sudo: false
1+
sudo: required
2+
3+
services:
4+
- docker
25

36
language: php
47

@@ -9,27 +12,23 @@ env:
912
global:
1013
- COMPOSER_FLAGS="--prefer-lowest --prefer-dist --no-interaction"
1114
- CODE_COVERAGE="--coverage-clover=coverage.clover"
12-
- ES_VERSION=2.4.4
13-
- ES_DOWNLOAD_URL=https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.tar.gz
1415

1516
cache:
1617
directories:
17-
- "vendor"
1818
- "$HOME/.composer/cache"
1919

2020
before_install:
21+
- chmod a+w -R docker/data
22+
- cp .env.dist .env
23+
- docker-compose up -d
2124
- if [[ -z $CODE_COVERAGE ]]; then phpenv config-rm xdebug.ini ; fi
2225
- composer self-update
23-
- wget ${ES_DOWNLOAD_URL}
24-
- tar -xzf elasticsearch-${ES_VERSION}.tar.gz
25-
- ./elasticsearch-${ES_VERSION}/bin/elasticsearch > elasticsearch.log 2>&1 &
26-
- wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200
2726

2827
install:
2928
- travis_retry composer update
29+
- wget -q --waitretry=2 --retry-connrefused -T 10 -O - http://127.0.0.1:19200
3030
- ./tests/bin/console elasticsearch:indices:create -e prod
3131
- ./tests/bin/console test:import:json my_index ./tests/app/data.json --adapter elasticsearch -e prod
32-
- ./tests/bin/console doctrine:database:create -e prod
3332
- ./tests/bin/console pucene:indices:create -e prod
3433
- ./tests/bin/console test:import:json my_index ./tests/app/data.json --adapter pucene -e prod
3534

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,24 @@
1414
"type": "library",
1515
"license": "MIT",
1616
"require": {
17-
"php": "^7.2",
17+
"php": "^7.1",
1818

1919
"symfony/config": "^3.0",
2020
"symfony/console": "^3.0",
2121
"symfony/http-kernel": "^3.0",
2222
"symfony/dependency-injection": "^3.0",
2323
"symfony/framework-bundle": "^3.0",
2424

25-
"elasticsearch/elasticsearch": "^2.0",
25+
"elasticsearch/elasticsearch": "^6.0",
2626
"ramsey/uuid": "^3.5",
2727
"doctrine/dbal": "^2.5"
2828
},
2929
"require-dev": {
3030
"doctrine/doctrine-bundle": "^1.6",
3131
"symfony/yaml": "^3.0",
3232
"jeroen/json-dump-reader": "^1.4",
33-
"phpunit/phpunit": "^6.0"
33+
"phpunit/phpunit": "^6.0",
34+
"symfony/dotenv": "^3.0"
3435
},
3536
"autoload": {
3637
"psr-4": {

docker-compose.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: '2'
2+
3+
services:
4+
mysql:
5+
build: docker/mysql
6+
ports:
7+
- ${PORT_MYSQL}:3306
8+
volumes:
9+
- ./docker/data/mysql:/var/lib/mysql
10+
environment:
11+
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
12+
MYSQL_DATABASE: ${MYSQL_DATABASE}
13+
MYSQL_USER: ${MYSQL_USER}
14+
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
15+
elasticsearch:
16+
build: docker/elasticsearch
17+
ports:
18+
- ${PORT_ELASTICSEARCH}:9200
19+
volumes:
20+
- ./docker/data/elasticsearch:/usr/share/elasticsearch/data
21+
environment:
22+
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
23+
kibana:
24+
build: docker/kibana
25+
ports:
26+
- ${PORT_KIBANA}:5601
27+
depends_on:
28+
- elasticsearch

docker/data/.gitkeep

Whitespace-only changes.

docker/data/elasticsearch/.gitkeep

Whitespace-only changes.

docker/data/mysql/.gitkeep

Whitespace-only changes.

docker/elasticsearch/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# https://github.com/elastic/elasticsearch-docker
2+
FROM docker.elastic.co/elasticsearch/elasticsearch:6.0.0
3+
4+
RUN rm /usr/share/elasticsearch/config/elasticsearch.yml
5+
ADD elasticsearch.yml /usr/share/elasticsearch/config/
6+
7+
RUN chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data
8+
RUN chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/config
9+
10+
# Add your elasticsearch plugins setup here
11+
# Example: RUN elasticsearch-plugin install analysis-icu
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
## Default Elasticsearch configuration from elasticsearch-docker.
3+
## from https://github.com/elastic/elasticsearch-docker/blob/master/build/elasticsearch/elasticsearch.yml
4+
#
5+
cluster.name: "docker-cluster"
6+
network.host: 0.0.0.0
7+
8+
# minimum_master_nodes need to be explicitly set when bound on a public IP
9+
# set to 1 to allow single node clusters
10+
# Details: https://github.com/elastic/elasticsearch/pull/17288
11+
discovery.zen.minimum_master_nodes: 1
12+
13+
## Use single node discovery in order to disable production mode and avoid bootstrap checks
14+
## see https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
15+
#
16+
discovery.type: single-node
17+
18+
## Single node setup dont need threshold
19+
#
20+
cluster.routing.allocation.disk.threshold_enabled: true
21+
22+
## Disable X-Pack
23+
## see https://www.elastic.co/guide/en/x-pack/current/xpack-settings.html
24+
## https://www.elastic.co/guide/en/x-pack/current/installing-xpack.html#xpack-enabling
25+
#
26+
xpack.security.enabled: false
27+
xpack.monitoring.enabled: false
28+
xpack.ml.enabled: false
29+
xpack.watcher.enabled: false

0 commit comments

Comments
 (0)