DocumentSplitter misplaces repeated literal chunks from an overlapping custom splitter
Los mantenedores suelen responder en 1 día
@davidsbatista ya está trabajando en esto.
Desde el 19/11/2026.
- #13807 de @lakshya-dhariwal — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Lee la búsqueda personalizada de offsets de división en haystack/components/preprocessors/document_splitter.py, alrededor de las líneas 349–373, y la prueba existente de ventana deslizante en test/components/preprocessors/test_document_splitter.py, alrededor de las líneas 346–371. Empieza ejecutando esa prueba y adaptando su caso para usar chunks repetidos y solapados. La corrección estará lista cuando los cuatro chunks comiencen en [0, 3, 6, 9], sus metadatos de solapamiento coincidan con esos rangos de origen y el recuperador devuelva go go go go go go.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
When a custom DocumentSplitter callback returns overlapping windows of repeated text, later copies can be picked in place of the actual overlapping windows. Some split_idx_start values then point beyond the source. A SentenceWindowRetriever using those chunks returns duplicated text.
Error message
No exception is raised.
Expected behavior
The four windows below have exactly four increasing literal source starts, [0, 3, 6, 9]. Their overlap metadata should describe those ranges, and the retrieved window should be go go go go go go. The existing custom-splitter test checks source offsets and overlap metadata for a sliding window with distinct text. Existing sliding-window test
Additional context
The splitter searches from the end of the previous chunk and only tries an earlier overlap when that search fails. For the second chunk below, it finds a later occurrence at offset 9. The third and fourth chunks then take the running fallback offsets, 17 and 25. Built-in word splitting with the same source and window sizes gives the expected offsets and text. Custom split offset lookup
To Reproduce
from haystack import Document
from haystack.components.preprocessors import DocumentSplitter
from haystack.components.retrievers import SentenceWindowRetriever
from haystack.document_stores.in_memory import InMemoryDocumentStore
def sliding_window(text):
words = text.split(" ")
return [" ".join(words[i : i + 3]) for i in range(len(words) - 2)]
text = "go go go go go go"
splitter = DocumentSplitter(
split_by="function",
splitting_function=sliding_window,
split_length=3,
split_overlap=2,
)
chunks = splitter.run(documents=[Document(content=text)])["documents"]
store = InMemoryDocumentStore()
store.write_documents(chunks)
retriever = SentenceWindowRetriever(document_store=store, window_size=len(chunks))
result = retriever.run(retrieved_documents=[chunks[2]])
print([chunk.meta["split_idx_start"] for chunk in chunks])
print(result["context_windows"][0])
Output on main:
[0, 9, 17, 25]
go go gogo go gogo go gogo go go
FAQ Check
- Read the Haystack FAQ.
System
- Ubuntu 24.04.2 LTS, x86_64
- Python 3.12.14
- Haystack main at
bbf5b2b429670fa866e388f9a734ff3b1c652bf8(VERSION.txtreports3.6.0-rc0)
OpenAI Codex prepared and ran the reproduction.
- Lenguaje dominante
- Python
- Estrellas
- 27.1k
- Forks
- 3.5k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 239
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de deepset-ai/haystack
-
BlockingConfirmationStrategy ignores an empty argument replacementPosiblemente ocupada @Aarkin7 la tomó hace 3 días. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
deepset-ai/haystack#13863 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
deepset-ai/haystack#13830 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
CSVToDocument accepts an unsupported conversion_mode and silently converts in row modePosiblemente ocupada @Lesereingrape la tomó hace 54 días. AbiertoP3
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
deepset-ai/haystack#13070 ·
Los mantenedores suelen responder en 1 día
-
InMemoryDocumentStore: count_unique_metadata_by_filter and get_metadata_field_unique_values disagree on int/float/bool valuesPosiblemente ocupada @sjrl la tomó hace 14 días. AbiertoP3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
deepset-ai/haystack#13040 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
CSVToDocument row mode fails on CR-separated CSV inputPosiblemente ocupada @julian-risch la tomó hace 55 días. AbiertoP3
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
deepset-ai/haystack#13022 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de deepset-ai/haystack
Issues similares
-
app: scripts status: backlog type: housekeeping
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
netbox-community/netbox-scripts#239 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
LmeSzinc/AzurLaneAutoScript#6194 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
micronaut-projects/micronaut-core#14585 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
langgenius/graphon#443 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día