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/
make build
./search build --soruces /path/to/folder/to/index --index /index/file/path
The program can be launched in two ways
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`
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.
If you want to use Kibana to view application logs:
- Add code to
backend
,building
andnginx
service indocker-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.