Changeset 442
- Timestamp:
- 10/05/07 18:16:12 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
EstCrawler/trunk/EstCrawler/tools/batch_est_cralwer
r439 r442 40 40 my $cdate = ts2iso($entry->blog, $entry->authored_on); 41 41 my $mdate = ts2iso($entry->blog, $entry->modified_on); 42 my $categories = join('', map { '[' . $_->label . ']' } @{$entry->categories}) 43 if $entry->categories; 44 my $tags = join('', map { '[' . $_ . ']' } $entry->tags) 45 if $entry->tags; 42 46 43 47 # metainfo (attribute, not searchable) … … 47 51 $doc->add_attr('@cdate', $cdate); 48 52 $doc->add_attr('@mdate', $mdate); 53 $doc->add_attr('entry_id', $entry->id); 54 $doc->add_attr('blog_id', $entry->blog_id); 55 $doc->add_attr('categories', $categories) if $categories; 56 $doc->add_attr('tags', $tags) if $tags; 49 57 50 58 # document body (searchable) … … 55 63 $doc->add_hidden_text($title); 56 64 $doc->add_hidden_text($author); 57 $doc->add_hidden_text( join(', ', map { $_->label } @{$entry->categories})|| '');58 $doc->add_hidden_text( join(', ', $entry->tags)|| '');65 $doc->add_hidden_text($categories || ''); 66 $doc->add_hidden_text($tags || ''); 59 67 $doc->add_hidden_text(remove_html($entry->keywords) || ''); 60 68 $doc;
