Source: site.view [edit]
Function name: t
Arguments:
Description:
Page type: webl
Render function:  
Module: skillsrank

Page source:

var P = NewPage(WubCall("itunesSongs", []), "text/xml");

var S = Seq(P, "key integer # key string # key string # key string # key string # key string # key string # key integer");

var res = [];

var songs = [];


var writer = Wub_NewLuceneIndex("music", true);

var ok = true;


every song in S do

   var title = Text(song[4]);
   var artist = Text(song[7]);
   var album = Text(song[13]);
   var genre = Text(song[16]);

   var doc = Wub_NewLuceneDocument();

   songs = songs + [title];
   
   ok = ok and Wub_AddLuceneField(doc, "title", title, true, true);
   ok = ok and Wub_AddLuceneField(doc, "artist", artist, true, true);
   ok = ok and Wub_AddLuceneField(doc, "album", album, true, true);
   ok = ok and Wub_AddLuceneField(doc, "genre", genre, true, true);
   
   ok = ok and Wub_AddLuceneField(doc, "all", title + " "+ album + " "+ artist + " "+ genre, true, true);
   ok = ok and Wub_AddLuceneDocument(writer, doc);

end;

ok = ok and Wub_OptimizeLucene(writer);
 
ok = ok and Wub_CloseLuceneIndex(writer);

songs;