From 77c65b39b5a28706889b2468c266c8e085a42e3c Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Thu, 1 Dec 2011 15:48:31 +0100 Subject: [PATCH 1/1] Split themes by , Do not add fragments with empty themes --- apps/search/index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/search/index.py b/apps/search/index.py index 9b7efa2b6..46fac4832 100644 --- a/apps/search/index.py +++ b/apps/search/index.py @@ -339,13 +339,16 @@ class Index(IndexStore): fragments[fid]['content'].append(start.tail) elif start is not None and start.tag == 'motyw': fid = start.attrib['id'][1:] - fragments[fid]['themes'].append(start.text) + if start.text is not None: + fragments[fid]['themes'] += map(unicode.strip, start.text.split(',')) fragments[fid]['content'].append(start.tail) elif start is not None and start.tag == 'end': fid = start.attrib['id'][1:] if fid not in fragments: continue # a broken node, skip it frag = fragments[fid] + if frag['themes'] == []: + continue # empty themes list. del fragments[fid] def jstr(l): -- 2.20.1