oscaruser@programmer.net
2006-Jul-25 19:25 UTC
[Xapian-discuss] How to build a shopping product categorization system?
Folks, We wanted to build up a shopping style categorization tree and was wondering if there are any features of Xapian that may help us with this goal. Basically it works like this, we have a predefined tree of categories e.g. Apparel & Accessories -> Clothing -> Women's Apparel -> Business Casual -> Blazers Is there a way to modify the index script (passed to scriptindex) to associate this information with the URL or Xapian record such that when a search is executed against a search term, the categorization information appears in a structured fashion defined by our omega template? title : weight=3 index truncate=80 field=caption url : field=url hash boolean=Q unique=Q html : unhtml index truncate=250 field=sample Thanks, OSC -- ___________________________________________________ Play 100s of games for FREE! http://games.mail.com/
James Aylett
2006-Jul-29 23:05 UTC
[Xapian-discuss] How to build a shopping product categorization system?
On Tue, Jul 25, 2006 at 10:25:00AM -0800, oscaruser@programmer.net wrote:> We have a predefined tree of categories e.g. > > Apparel & Accessories -> Clothing -> Women's Apparel -> Business > Casual -> Blazers > > Is there a way to modify the index script (passed to scriptindex) to > associate this information with the URL or Xapian record such that > when a search is executed against a search term, the categorization > information appears in a structured fashion defined by our omega > template?If you turn it into a document data field, you can use $split to chop it up. Say you store the above as "Apparel & Accessories/Clothing/...", you could have: categories: field=categories $list{$map{$split{/, $field{categories}},<span class='category'>$html{$_}</span>}, -> } If you stored tokens instead of strings you could turn them into links as well by using a $setmap{}. (You can also localize that way, if you need to.) James -- /--------------------------------------------------------------------------\ James Aylett xapian.org james@tartarus.org uncertaintydivision.org
oscaruser@programmer.net
2006-Jul-30 07:24 UTC
[Xapian-discuss] How to build a shopping product categorization system?
Good info, thanks, giving it a go...> ----- Original Message ----- > From: "James Aylett" <james-xapian@tartarus.org> > To: xapian-discuss@lists.xapian.org > Subject: Re: [Xapian-discuss] How to build a shopping product categorization system? > Date: Sat, 29 Jul 2006 23:05:01 +0100 > > > On Tue, Jul 25, 2006 at 10:25:00AM -0800, oscaruser@programmer.net wrote: > > > We have a predefined tree of categories e.g. Apparel & > > Accessories -> Clothing -> Women's Apparel -> Business > > Casual -> Blazers > > > > Is there a way to modify the index script (passed to scriptindex) to > > associate this information with the URL or Xapian record such that > > when a search is executed against a search term, the categorization > > information appears in a structured fashion defined by our omega > > template? > > If you turn it into a document data field, you can use $split to chop > it up. Say you store the above as "Apparel & > Accessories/Clothing/...", you could have: > > categories: field=categories > > $list{$map{$split{/, $field{categories}},<span > class='category'>$html{$_}</span>}, -> } > > If you stored tokens instead of strings you could turn them into links > as well by using a $setmap{}. (You can also localize that way, if you > need to.) > > James > > -- > /--------------------------------------------------------------------------\ > James Aylett xapian.org > james@tartarus.org uncertaintydivision.org > > _______________________________________________ > Xapian-discuss mailing list > Xapian-discuss@lists.xapian.org > http://lists.xapian.org/mailman/listinfo/xapian-discuss>-- ___________________________________________________ Play 100s of games for FREE! http://games.mail.com/