Skip to content

polisgo2020/search-senyast4745

Repository files navigation

invindex

github.com/polisgo2020/search-senyast4745 implements inverted index to perform full-text search.

Test stand address http://ec2-3-19-213-109.us-east-2.compute.amazonaws.com/

Build application

make build

Usage

Run build index

./search build --soruces /path/to/folder/to/index --index /index/file/path

Run search

The program can be launched in two ways

Console search

export LISTEN=inteface-to-listen
export LOG_LEVEL=log-level
export TIMEOUT=server-timeout  
./search search --index /index/file/path

After it you can send request to server

POST /?search=`search-phrase` HTTP/1.1
Host: `interfase-to-listen`

Search + building index in docker

You can up invindex in docker-compose:

mkdir ./data
mkdir -p ./mongo/data
cp /data/files/folder ./data
export LOG_LEVEL=<log-level>;DATABASE=<your-database-name>
export DB_USERNAME=<your-database-user>;DB_PASSWORD=<your-database-password>
export DB_INTERFACE=mongo://<DB_USERNAME>:<DB_PASSWORD>@<your-database-host>
docker-compose up -d

To start the build and search in Docker, you must have the ./data folder in the same directory as the docker-compose.yml file. Files to index should be in this (./data) folder.

After it you can go in your browser to localhost and start searching by web-interface.

Add Kibana logs

If you want to use Kibana to view application logs:

  • Add code to backend, building and nginx service in docker-compose.yml:
    logging:
      driver: "fluentd"
      options:
        fluentd-address: localhost:24224
        tag: backend.log
  • After run Elastic Stack:
docker-compose -f docker-compose-logs.yml up -d
  • Then repeat the steps from the stage: "Search in docker".

To secure your logs see this guide.

About

search-senyast4745 created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published