Skip to content

Commit 8883185

Browse files
authored
Merge pull request #37 from KillrVideo/search_fix
fix Search + version + env variables + scripts to run locally
2 parents 7f2c8a2 + 10b792c commit 8883185

39 files changed

Lines changed: 149 additions & 2347 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
# Build the app and a docker image
1111
script:
1212
- mvn clean install
13-
- docker build -t ${TRAVIS_COMMIT} --build-arg JAR_FILE=target/killrvideo-services-6.7.0.jar ./killrvideo-services
13+
- docker build -t ${TRAVIS_COMMIT} --build-arg JAR_FILE=target/killrvideo-services-3.0.0.jar ./killrvideo-services
1414

1515
# If successful, see if we need to publish also
1616
after_success:
@@ -29,4 +29,4 @@ notifications:
2929
slack:
3030
rooms:
3131
secure: N6FrJ0l0gw2t1wnty/xPDKvLBZlzOAmkIbHjd4ZrtaC4vLU8iZP+YCRvQd7Vwzc97yDhHIZ41eGtjHjBIIeMX/3rfuS+6GA4VJgyNFGsP0f81YYHxiMOEUlVa2O6LBwbF3LokaFi3l7Iau1c5Op9c3LinhTdE0W6KG+2gxEqSKJkBcVJfK9SZGXg3+6qlq065BWx7xWlzoWgMFyipJJLW1BAqEzP5cc6hHozJ5H/8ucMaJbWQF+nOaIYUJdaop4ChSpe6EFyg0XNp+mIjJ2BxZ6hfYrAs69vwBapBepe4zEoR5xdN1dGUAIDqNY9rr4Npp8InFmBmnlL1xG6FeG73C2qfSr3Y2WziOtwececzmuQWI2Do9ioB5k0KtC4UAV42tpADUODrrwxE8S32tqgr0Pojg8FvgsM6O3twvF1UH3LLEyW7zDzuDpYdtvIROWZGerxyWqQIFI7MzragyL+ZiKKUOG1uKsA8DoeECcMHuUsDEsR/mHalmQGGl2ZNGpphAHg/1HtjB32VDCIuZpFHsqFG7BfMY2dg8Mm+ea4j9imOxM+2TFxbPhoIjIJq1o+/YvolrYviWgmQOpeFw0c1xXWSL5aXmBv2nUnlBaXxfzC9FTl0xmovJmKeYhqJ81TMa33gimsMeccZIDmzcMDsW82idsvtHeNDSX1wil5DXA=
32-
32+

docker-compose-kafka.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

docker-compose-old.yaml

Lines changed: 0 additions & 69 deletions
This file was deleted.

docker-compose.yml

Lines changed: 53 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,75 @@
11
version: '3'
2+
3+
#
4+
# docker-compose.yaml
5+
# Simple compose file for running the Python services in Docker along with other containers comprising the
6+
# KillrVideo.
7+
# For more complex configuration options including metrics, external volumes, OpsCenter,
8+
# etc., see https://github.com/KillrVideo/killrvideo-docker-common
9+
#
10+
# Note: the default configuration here uses the LATEST version of the killrvideo-python
11+
# Docker image, which can be built using scripts/docker_build.sh.
12+
#
13+
214
services:
315

4-
# ----------------------------------
16+
web: # Web Interface
17+
image: killrvideo/killrvideo-web:3.0.1
18+
ports:
19+
- "3000:3000" # Exposes port to be available externally
20+
depends_on:
21+
- backend # Needs Backend to be running
22+
environment:
23+
KILLRVIDEO_LOGGING_LEVEL: debug # More logging
24+
25+
# Service implementation - use docker-compose-backend-external.yaml if running services in IDE
26+
backend: # KillrVideo Backend
27+
image: killrvideo/killrvideo-java
28+
ports:
29+
- "50101:50101" # Exposes port to be available. Kompose tool needs that to create a k8s service and make backend available for other services.
30+
depends_on:
31+
- dse # Needs DSE to be running
32+
environment:
33+
KILLRVIDEO_LOGGING_LEVEL: debug # More logging
34+
KILLRVIDEO_DSE_CONTACT_POINTS: dse
35+
36+
# Datastax Studio provides convenient web interface to work directly with DataStax Enterprise
37+
studio:
38+
image: datastax/dse-studio:6.7.0
39+
ports:
40+
- "9091:9091" # Exposes port to be available externally
41+
depends_on:
42+
- dse # Needs DSE to be running
43+
environment:
44+
DS_LICENSE: accept
45+
546
# DataStax Enterprise Database
6-
# ----------------------------------
747
dse:
8-
image: datastax/dse-server:6.7.2
48+
image: datastax/dse-server:6.7.4
949
command: [ -s -g ] # Run with Search and Graph capabilities enabled
10-
ports: # Exposes ports to be available. Kompose tool needs that to create a k8s service and make backend available for other services.
50+
ports: # Exposes ports to be available.
1151
- "9042:9042" # Exposes DSE port
1252
- "8983:8983" # Exposes DSE Search port
1353
- "8182:8182" # Exposes DSE Graph port
1454
environment:
1555
DS_LICENSE: accept # Accept licence on start
16-
DC: DC1
17-
JVM_EXTRA_OPTS: -Xmx1g -Xms1g
18-
NUM_TOKENS: 32
1956
cap_add:
2057
- IPC_LOCK # Allow DSE to lock memory with mlock
21-
depends_on:
22-
# - opscenter
2358
ulimits:
2459
memlock: -1
25-
26-
# ----------------------------------
27-
# DataStax Studio
28-
# ----------------------------------
29-
studio:
30-
image: datastax/dse-studio:6.7.0
31-
ports:
32-
- "9091:9091"
33-
depends_on:
34-
- dse
35-
environment:
36-
SERVICE_9091_NAME: studio
37-
DS_LICENSE: accept
38-
volumes:
39-
- "/tmp/docker/studio-notebooks:/var/lib/datastax-studio"
40-
41-
# ----------------------------------
42-
# OpsCenter
43-
# ----------------------------------
44-
#opscenter:
45-
# image: "datastax/dse-opscenter:6.7.0"
46-
# ports:
47-
# - 8888:8888
48-
# environment:
49-
# - DS_LICENSE=accept
50-
51-
# ----------------------------------
52-
# Killrvideo
53-
# ----------------------------------
54-
55-
# ----------------------------------
56-
# Web Interface (No ETCD)
57-
# ----------------------------------
58-
web:
59-
image: killrvideo/killrvideo-web:3.0.0
60-
ports:
61-
- "3000:3000" # Exposes port to be available externally
62-
depends_on:
63-
- backend # Needs Backend to be running
64-
environment:
65-
KILLRVIDEO_LOGGING_LEVEL: debug # More logging
66-
labels:
67-
kompose.service.type: nodeport # Adds a label for Kompose to expose service externally
6860

69-
# ----------------------------------
70-
# Backend exposing GRPC services
71-
# ----------------------------------
72-
backend:
73-
# JAVA IMPLEMENTATION
74-
image: killrvideo/killrvideo-java:latest
75-
# Exposes port to be available. Kompose tool needs that to create a k8s service and make backend available for other services.
76-
ports:
77-
- "50101:50101"
78-
depends_on:
79-
- dse
80-
environment:
81-
KILLRVIDEO_LOGGING_LEVEL: debug
82-
KILLRVIDEO_DSE_USERNAME: $KILLRVIDEO_DSE_USERNAME
83-
KILLRVIDEO_DSE_PASSWORD: $KILLRVIDEO_DSE_PASSWORD
84-
KILLRVIDEO_ENABLE_SSL: $KILLRVIDEO_ENABLE_SSL
85-
volumes:
86-
- "../../cassandra.cert:/usr/src/app/cassandra.cert"
87-
88-
dse-config: # One-Time Bootstrap Container, configures DSE to have required keyspaces etc.
61+
# One-Time Bootstrap Container, configures DSE to have required keyspaces etc.
62+
dse-config:
8963
image: killrvideo/killrvideo-dse-config:3.0.0
90-
environment:
91-
KILLRVIDEO_SERVICE_DISCOVERY_DISABLED: 'true' # Backward Compatibility Requirement
9264
depends_on:
9365
- dse # Needs DSE to be running
94-
restart: on-failure # Kompose needs that to create dse-config as a pod, not a deployment. DSE-Config deployment is not needed as we run it only once.
9566

96-
generator:
97-
image: killrvideo/killrvideo-generator:3.0.0
67+
# Sample Data Generator, imitates behaviour of users on the killrVideo website.
68+
# Adds comments and rates videos, upload new videos and so on.
69+
generator:
70+
image: killrvideo/killrvideo-generator:3.0.1
9871
depends_on:
99-
- backend
72+
- backend # Needs Backend to be running
10073
environment:
101-
KILLRVIDEO_LOGGING_LEVEL: debug
102-
74+
KILLRVIDEO_LOGGING_LEVEL: debug # More logging
75+

killrvideo-commons/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.datastax</groupId>
1313
<artifactId>killrvideo-parent</artifactId>
14-
<version>6.7.0</version>
14+
<version>3.0.0</version>
1515
</parent>
1616

1717
<dependencies>

killrvideo-commons/src/main/java/com/killrvideo/messaging/dao/MessagingDao.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public interface MessagingDao {
3636
* @param t
3737
*/
3838
default CompletableFuture<Object> sendErrorEvent(String serviceName, Throwable t) {
39-
return sendEvent(getErrorDestination(), mapError(t));
39+
return sendEvent(getErrorDestination(), mapError(t));
4040
}
4141

4242
/**

killrvideo-service-comments/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>com.datastax</groupId>
1919
<artifactId>killrvideo-parent</artifactId>
20-
<version>6.7.0</version>
20+
<version>3.0.0</version>
2121
</parent>
2222

2323
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

killrvideo-service-ratings/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>com.datastax</groupId>
1919
<artifactId>killrvideo-parent</artifactId>
20-
<version>6.7.0</version>
20+
<version>3.0.0</version>
2121
</parent>
2222

2323
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

killrvideo-service-search/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<parent>
1818
<groupId>com.datastax</groupId>
1919
<artifactId>killrvideo-parent</artifactId>
20-
<version>6.7.0</version>
20+
<version>3.0.0</version>
2121
</parent>
2222

2323
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

killrvideo-service-search/src/main/java/com/killrvideo/service/search/dao/SearchDseDao.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ public ResultListPage<Video> searchVideos(String query, int fetchSize, Optional<
147147
* https://docs.datastax.com/en/dse/5.1/dse-dev/datastax_enterprise/search/cursorsDeepPaging.html#cursorsDeepPaging__srchCursorCQL
148148
*/
149149
private BoundStatement createStatementToQuerySuggestions(String query, int fetchSize) {
150-
151-
final StringBuilder solrQuery = new StringBuilder();
152-
solrQuery.append("{\"q\":\"search_suggestions:");
153-
solrQuery.append(query);
154-
solrQuery.append("*\", \"paging\":\"driver\"}");
155-
150+
final StringBuilder solrQuery = new StringBuilder()
151+
.append(pagingDriverStart)
152+
.append("name:(").append(query).append("*) OR ")
153+
.append("tags:(").append(query).append("*) OR ")
154+
.append("description:(").append(query).append("*)")
155+
.append(pagingDriverEnd);
156+
LOGGER.debug("getQuerySuggestions() solr_query is : {}", solrQuery.toString());
157+
156158
BoundStatement stmt = findSuggestedTags.bind().setString("solr_query", solrQuery.toString());
157159
stmt.setFetchSize(fetchSize);
158160
LOGGER.debug("getQuerySuggestions: {} with solr_query: {}", stmt.preparedStatement().getQueryString(), solrQuery);

0 commit comments

Comments
 (0)