12 releases

0.1.11 Nov 9, 2023
0.1.10 Oct 3, 2023
0.1.9 Sep 1, 2023
0.1.8 Aug 28, 2023

#1149 in Text processing

Download history 4/week @ 2024-02-16 6/week @ 2024-02-23 1/week @ 2024-03-01 3/week @ 2024-03-08 7/week @ 2024-03-15 86/week @ 2024-03-29

96 downloads per month

MPL-2.0 license

31KB
538 lines

File search

Index and search file content (xlsx, csv, pdf)

endpoints

Index

POST http://localhost:8080/index
{
  "file_path": "/home/nordine/test.xlsx"
}

GET http://localhost:8080/search?page=0&per_page=10&q=sango&query_type=regexQuery

environment variables:

env default value
SERVICE_COLLECTION_NAME file-search
SERVICE_HOST 0.0.0.0
SERVICE_PORT 8080
INDEX_DIR_PATH /tmp/__tantivy_data
RUST_LOG N/A
INDEX_WRITER_SIZE 50000000 (50mb)

install

  • use the installation script from the latest release
  • create file /etc/systemd/system/file-search.service and paste the following:
[Unit]
Description=File Index Search service
After=network.target
StartLimitIntervalSec=0
[Service]
Environment=RUST_LOG=debug
Environment=INDEX_DIR_PATH=<your-home>/.tantivy_data
Type=simple
Restart=always
RestartSec=1
User=<your-user>
ExecStart=<your-home>/.cargo/bin/file-search

[Install]
WantedBy=multi-user.target
  • start service: sudo systemctl start file-search
  • check logs: sudo journalctl -f -u file-search

Dependencies

~46–81MB
~1M SLoC