docling-studio/document-parser/infra
Pier-Jean Malandrino 45cecc1115 fix(neo4j): rewrite fetch_graph with CALL subqueries
Previous query chained 6 OPTIONAL MATCH clauses for edges with no
intervening WITH collect(), producing a cartesian product. At 6 pages
(~60 elements, ~300 edges) Neo4j hit 102% CPU and hung > 5min.

Rewritten with one CALL {} subquery per node/edge type: each block
returns a single row with its collected list — no multiplication across
types. 6-page doc now returns in 213ms (was: no return).

Python reshape code (queries.py:137-210) untouched — record keys and
edge map shape preserved.

Refs: https://neo4j.com/developer/kb/using-subqueries-to-control-the-scope-of-aggregations/
2026-04-29 14:00:00 +02:00
..
neo4j fix(neo4j): rewrite fetch_graph with CALL subqueries 2026-04-29 14:00:00 +02:00
__init__.py Refactor backend to hexagonal architecture for converter extensibility 2026-03-31 10:34:07 +02:00
bbox.py Move bbox.py from domain/ to infra/ and unify coordinate logic 2026-04-03 13:17:26 +02:00
embedding_client.py feat: add embedding microservice and EmbeddingService port 2026-04-10 20:53:24 +02:00
local_chunker.py feat(neo4j): Day 3 — ChunkWriter, graph API, GraphView, README 2026-04-29 14:00:00 +02:00
local_converter.py refactor: centralize magic numbers for page dimensions, limits, and timeout (#168) 2026-04-29 14:00:00 +02:00
opensearch_store.py refactor: centralize magic numbers for page dimensions, limits, and timeout (#168) 2026-04-29 14:00:00 +02:00
rate_limiter.py Add in-memory rate limiting middleware 2026-04-03 13:56:05 +02:00
serve_converter.py feat: enable chunking in remote (Docling Serve) mode 2026-04-29 14:00:00 +02:00
settings.py feat(neo4j): Day 1 — compose service, driver, schema bootstrap 2026-04-29 14:00:00 +02:00