Benjamin Krause <[EMAIL PROTECTED]> writes: > Hey .. > > what you should do is to write your own analyzer.. that splits > the HWAddress at the : and therefore stores each part of > the MAC address as a separate token.. this can be done using > the RegExpAnalyzer .. maybe like that: > > RegExpAnalyzer.new(/[^:]+/, true) [1] > > I would then search via SpanNearQueries [2] to search for certain > MAC parts in a specific order.. like that > > query = SpanNearQuery.new(:slop => 5, :in_order => true) > query << SpanTermQuery.new(:hwaddr, "11") > query << SpanTermQuery.new(:fhwaddr, "22") > > this should find all items with 11<something>22 > > Hope that helps ..
Hey it does. Thanks. I first thought it was a bug and I would have liked an easier solution. (for ex: stop the Analyzer to condiser ':' as a stop word ) I don't think I need to use the RegExpAnalyzer for hwaddr since the Standard one also cuts on ':'. I'm going to use :slop=>1, :in_order => true And I'll try to detect hwaddr search queries to feed SpanNearQuery accordingly by looking for ':' in the query and see if the word before ':' matches a fieldname. (if it doesn't and looks like a hwaddr I'll feed SpanNearQuery) Pretty sure that could be done in a nicer way. (don't hesitate to make suggestions :)) Also if there's other ways to index mac addresses without splitting on : I would be interested to read about them. (especially if I can use the query without too much processing) Anyway, Thanks again for the quick answer. -- _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

