Skip to content

Production-style PHP / MSSQL → Elasticsearch 7.17 reindex & background worker system — batching, retry logic, idempotent upserts via acckey.

License

Notifications You must be signed in to change notification settings

BRadivojevic/php-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elasticsearch 7 Reindex & Insert Workers (MSSQL + Background Jobs) — acckey idempotency

Production-grade PHP project for indexing very large SQL Server datasets into Elasticsearch 7.17.13, with:

  • Server-side batching via ROW_NUMBER() / OFFSET ... FETCH
  • Background workers to avoid Cloudflare 524/534 timeouts
  • Idempotent upserts using acckey as _id
  • Dead-letter logging for malformed/missing IDs
  • JSON logging and clean normalization (dates/diacritics)

Author: Boško RadivojevićBRadivojevic

Setup (no terminal needed)

  1. Open in PhpStorm/VS Code → use Composer GUI to install.
  2. Copy .env.example.env and set ES + MSSQL.
  3. Serve public/ with your IDE.
  4. POST JSON to queue-reindex.php to enqueue; run workers/reindex_worker.php from IDE to process.

Insert from MSSQL → ES (with acckey idempotency)

  • Put SQL in examples/select_batch_row_number.sql (uses ? for start,end).
  • Run workers/insert_bulk_worker.php from IDE with Program arguments: index=your_index sql=examples/select_batch_row_number.sql start=1 end=10000

© 2025 Boško Radivojević. MIT License.

About

Production-style PHP / MSSQL → Elasticsearch 7.17 reindex & background worker system — batching, retry logic, idempotent upserts via acckey.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages