Urgent.News

What's breaking now, across thousands of outlets.

Tech

Meilisearch is the easy part. The sync worker is where it hurts.

Suppose your product catalog lives in Postgres and search is ILIKE '%term%' . It works, nobody complains, and the table is small. Then hedphones returns nothing, the query plan turns into a sequential scan, and you start reading about Meilisearch. The indexing part is genuinely easy. docker compose up , create the index, push documents, done. The guide linked below walks the whole build and every…

Meilisearch's search functionality works well with a simple ILIKE query, but the worker component that keeps the search index in sync with the database presents challenges. Setting up Meilisearch in Docker compose, indexing 20,002 rows from PostgreSQL, reveals issues with the cursor-based pagination. The timestamp used for updates in PostgreSQL is not accurate, leading to missing documents when incrementing the cursor using "=".

Switching to the equal sign resolves the issue but causes the worker to stall at a specific number of documents. A fix involves using a composite index with both the updated_at timestamp and id field. Another trap lies in the handling of timestamps in PostgreSQL, which converts timestamptz to JavaScript Date objects with milliseconds.

Selecting this column without casting can cause issues with the cursor format. Meilisearch and PostgreSQL return different results for similar queries, with Meilisearch handling prefix matching better. The design choice of strict AND matching and ignoring edit distance comes at the cost of increased storage requirements, with Meilisearch needing roughly 4.3 times more disk space for the same number of documents.

Despite these challenges, the architecture proves beneficial due to the ease of rebuilding the index when issues arise.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

MackIAExpend -Hacktoberfest

Vending Machine: ESP32, Raspberry Pi Pico, NFC, n8n, Lovable & ElevenLabs This is a submission for the MLH x DEV Writing Challenge What I Built…..

  • MackIAExpend submits IoT vending machine for MLH x DEV Writing Challenge
  • Raspberry Pi Pico handles local user interface with TFT display
  • ElevenLabs provides AI voice responses for successful dispensing

Lossless PNG optimizing saved 11.4% on transparent icons and 24.8% on photos

My capstone project has a folder of PNG assets: app icons and stickers with soft transparent edges, plus a few photos that someone exported as PNG.

  • Lossless PNG optimizer oxipng achieved 11.4% reduction on transparent icons
  • Optimizer saved 24.8% on photos from Wikimedia Commons
  • Reduction techniques include recompression and color type reduction

More from Friday 6 November →