Closed GoogleCodeExporter closed 9 years ago
It seems self.__class__.fields is supposed to return a list, but it returns a
tuple
containing the fields, like (['title', 'body'],) so the code figures these are
tags
instead of fields.
I'm using last django trunk version.
Original comment by antoni.aloy@gmail.com
on 8 Mar 2009 at 2:57
Please post here you indexer class definition
Original comment by daevaorn
on 8 Mar 2009 at 6:26
Here it its. Modifiying the code to manage what we get from Django in the init
works
for me ...
{{{
class EntryIndexer(djapian.Indexer):
fields = ['headline',
'body_markdown',
],
tags=[
( "title","headline", 1),
( "body","body_markdown", 2),
]
trigger=lambda indexer, obj: obj.active
djapian.add_index(Entry, EntryIndexer, attach_as="indexer")
}}}
Original comment by antoni.aloy@gmail.com
on 8 Mar 2009 at 8:10
Oh, you have unneeded comma after fields list closing brace
Original comment by daevaorn
on 8 Mar 2009 at 9:25
:) True
I shoud have checked the code alt lest a dozen of times :). Thanks!
Original comment by antoni.aloy@gmail.com
on 8 Mar 2009 at 9:31
I've removed the comma and it works perfectly. Thanks again!
Original comment by antoni.aloy@gmail.com
on 8 Mar 2009 at 9:35
Ok. Glad to help.
Original comment by daevaorn
on 8 Mar 2009 at 9:37
Original comment by daevaorn
on 8 Mar 2009 at 10:22
Original issue reported on code.google.com by
antoni.aloy@gmail.com
on 8 Mar 2009 at 1:00