This commit is contained in:
parent
c5f29ab4ae
commit
b0c69ad3e0
|
|
@ -78,7 +78,11 @@ def render_graph_explorer_cytoscape(graph_service):
|
|||
options = {}
|
||||
for h in hits:
|
||||
if h.payload and 'title' in h.payload and 'note_id' in h.payload:
|
||||
options[h.payload['title']] = h.payload['note_id']
|
||||
title = h.payload['title']
|
||||
note_id = h.payload['note_id']
|
||||
# Vermeide Duplikate (falls mehrere Chunks/Notes denselben Titel haben)
|
||||
if title not in options:
|
||||
options[title] = note_id
|
||||
|
||||
if options:
|
||||
selected_title = st.selectbox("Ergebnisse:", list(options.keys()), key="cy_select")
|
||||
|
|
@ -87,8 +91,13 @@ def render_graph_explorer_cytoscape(graph_service):
|
|||
st.session_state.graph_center_id = new_id
|
||||
st.session_state.graph_inspected_id = new_id
|
||||
st.rerun()
|
||||
else:
|
||||
# Zeige Info, wenn keine Ergebnisse gefunden wurden
|
||||
st.info(f"Keine Notizen mit '{search_term}' im Titel gefunden.")
|
||||
except Exception as e:
|
||||
st.error(f"Fehler bei der Suche: {e}")
|
||||
import traceback
|
||||
st.code(traceback.format_exc())
|
||||
|
||||
st.divider()
|
||||
|
||||
|
|
|
|||
|
|
@ -224,9 +224,10 @@ class GraphExplorerService:
|
|||
res_in, _ = self.client.scroll(self.edges_col, scroll_filter=in_filter, limit=2000, with_payload=True)
|
||||
results.extend(res_in)
|
||||
|
||||
# Case D: ZUSÄTZLICHE Suche für "Titel#Abschnitt" Format
|
||||
# Case D: ZUSÄTZLICHE Suche für "Titel#Abschnitt" Format (nur für INCOMING edges)
|
||||
# Da Qdrant keine Wildcard-Suche hat, müssen wir breiter suchen und clientseitig filtern
|
||||
# Wir suchen nach allen Kanten, die mit einem unserer Titel beginnen
|
||||
# WICHTIG: Diese Suche ist nur für eingehende Kanten relevant
|
||||
# Für ausgehende Kanten werden alle über note_id gefunden, unabhängig vom target_id Format
|
||||
if note_titles_to_search:
|
||||
# Erweiterte Suche: Lade alle relevanten Kanten und filtere clientseitig
|
||||
# Dies ist notwendig, weil "Titel#Abschnitt" nicht exakt mit "Titel" übereinstimmt
|
||||
|
|
@ -236,7 +237,7 @@ class GraphExplorerService:
|
|||
)
|
||||
# Lade Kanten für die clientseitige Filterung (Limit basierend auf Anzahl der Titel)
|
||||
# Für jeden Titel könnten mehrere "Titel#Abschnitt" Varianten existieren
|
||||
res_extended, _ = self.client.scroll(self.edges_col, scroll_filter=extended_filter, limit=3000, with_payload=True)
|
||||
res_extended, _ = self.client.scroll(self.edges_col, scroll_filter=extended_filter, limit=2000, with_payload=True)
|
||||
|
||||
# Clientseitige Filterung: Finde Kanten, deren target_id mit einem unserer Titel beginnt
|
||||
# Erstelle Set der bereits gefundenen Edge-IDs für schnelle Deduplizierung
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user