I'm trying to determine the best way to index facets with multiple values. For example, let's say we have several books and we want an Author facet where one can filter the books by the author. The problem is each book can have multiple authors. Is there a way to index multiple author names into a single value slot for each book? I see there is a Xapian::StringListSerialiser class that appears to be what I want, but I don't see this class in the Ruby bindings (I'm using Xapian 1.2.2). If this is not available in the Ruby bindings, are there any work-around solutions to this problem? Ryan
Ryan Bates wrote on 6/14/11 1:59 PM:> I see there is a Xapian::StringListSerialiser class that appears to be > what I want, but I don't see this class in the Ruby bindings (I'm > using Xapian 1.2.2). If this is not available in the Ruby bindings, > are there any work-around solutions to this problem?Swish3 uses the workaround of joining multiple values with ASCII \x03 as in this example in C++: http://dev.swish-e.org/browser/libswish3/trunk/src/xapian/swish_xapian.cpp#L224 SWISH_TOKENPOS_BUMPER is defined here: http://dev.swish-e.org/browser/libswish3/trunk/src/libswish3/libswish3.h#L119 -- Peter Karman . http://peknet.com/ . peter at peknet.com
On Tue, Jun 14, 2011 at 11:59:38AM -0700, Ryan Bates wrote:> I see there is a Xapian::StringListSerialiser class that appears to be > what I want, but I don't see this class in the Ruby bindings (I'm > using Xapian 1.2.2). If this is not available in the Ruby bindings, > are there any work-around solutions to this problem?This class is only currently on a branch: http://trac.xapian.org/ticket/199 But it really doesn't do much more than just join together the values like Peter suggested. The only difference is it encodes them so that it works for any byte in the values. Cheers, Olly