diff --git a/docker-compose-hub-server.yml b/docker-compose-hub-server.yml index 7479e75..6825688 100644 --- a/docker-compose-hub-server.yml +++ b/docker-compose-hub-server.yml @@ -1,38 +1,34 @@ -version: "3" - -volumes: - es01: - -services: - hub_server: - depends_on: - - es01 - image: lbry/hub:latest - restart: always - ports: - - "50051:50051" # rpc port - environment: - #- TCP_PORT=50051 # should probably have these supported by the go server too - #- TCP_HOST=0.0.0.0 - - ELASTIC_HOST=http://127.0.0.1 - - ELASTIC_PORT=9200 - es01: - image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1 - container_name: es01 - environment: - - node.name=es01 - - discovery.type=single-node - - indices.query.bool.max_clause_count=4096 - - bootstrap.memory_lock=true - - "ES_JAVA_OPTS=-Xms512m -Xmx512m" # no more than 32, remember to disable swap - #- "ES_JAVA_OPTS=-Xms8g -Xmx8g" # no more than 32, remember to disable swap - ulimits: - memlock: - soft: -1 - hard: -1 - volumes: - - es01:/usr/share/elasticsearch/data - ports: - - "9200:9200" - - "9300:9300" - #- 127.0.0.1:9200:9200 +version: "3" + +volumes: + es01: + +services: + hub_server: + depends_on: + - es01 + image: lbry/hub:latest + restart: always + environment: + #- TCP_PORT=50051 # should probably have these supported by the go server too + #- TCP_HOST=0.0.0.0 + - ELASTIC_HOST=http://127.0.0.1 + - ELASTIC_PORT=9200 + network_mode: host + es01: + image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1 + container_name: es01 + environment: + - node.name=es01 + - discovery.type=single-node + - indices.query.bool.max_clause_count=4096 + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" # no more than 32, remember to disable swap + #- "ES_JAVA_OPTS=-Xms8g -Xmx8g" # no more than 32, remember to disable swap + ulimits: + memlock: + soft: -1 + hard: -1 + volumes: + - es01:/usr/share/elasticsearch/data + network_mode: host diff --git a/server/search.go b/server/search.go index 1ee0024..99a8fcc 100644 --- a/server/search.go +++ b/server/search.go @@ -614,7 +614,11 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.Outputs, if err != nil { log.Fatalln(err) } - searchIndices := make([]string, len(indices)-1) + var numIndices = 0 + if len(indices) > 0 { + numIndices = len(indices) - 1 + } + searchIndices := make([]string, numIndices) j := 0 for i := 0; i < len(indices); i++ { if indices[i] == "claims" {