RenderSolrTagCloud
Renders a tag cloud using Solr

Documentation

TODO

Parameters
  • DAYS: number of recent days of changes to take under consideration, defaults to unlimited
  • RECENCY: maximum number of topics to harvest tags from, defaults to 100; a value of "all" will render a tag cloud considering all matching documents
  • LIMIT: maximum number of tags in the could, defaults to 100
  • MIN: minimum frequency of a tags to be shown
  • TAG: comma separated list of tags to be searched for in the archive
  • CAT: restrict tag cloud to this category; displays all tags of all categories if unspecified
  • KEYWORDS: keywords to filter for
  • THEWEB: web to restrict search to, defaults to all
  • TYPE: content type to restrict results to, e.g. "topic" (default), "image", "video", "pdf", "zip", …

Implementation

%STARTINCLUDE%<noautolink>
%DBCALL{"%WEB%.%TOPIC%" 
  section="search"
  keywords="%KEYWORDS{default=""}%"
  theweb="%SUBST{text="%THEWEB{default="all"}%" pattern="/" format="."}%"
  limit="%LIMIT{default="100"}%"
  filter="type:%TYPE{default="topic"}% %IF{"defined THEWEB and $THEWEB!='all'" 
            then="web:%SUBST{text="%THEWEB{default=""}%" pattern="/" format="."}%"
          }% %IF{"defined TAG" 
            then="$percntFORMATLIST{\"%TAG%\" split=\"\*s,\s*\" format=\"tag:$1\" separator=\", \"}$percnt"
          }% %IF{"defined CAT" 
            then="$percntFORMATLIST{\"%CAT%\" split=\"\*s,\s*\" format=\"category:$1\" separator=\", \"}$percnt"
          }% %IF{"defined DAYS"
            then="date:\\"[NOW/DAY-%DAYS%DAY TO NOW]\\""
          }%"
}% %TAGCLOUD{
  terms="%SOLRFORMAT{
    "solrtagcloud1"
    format_tag="$key:$count,"
    separator_tag=" "
  }%"
  header="<div class='solrTagCloud clsTagCloud'>"
  format="<span style='font-size:$weightpx;line-height:110%'><a href='$percntSOLRSCRIPTURL{topic=\"%BASEWEB%.WebSearch\" tag=\"$term\" category=\"%CAT{default=""}%\" web=\"%SUBST{text="%THEWEB{default=""}%" pattern="/" format="."}%\" type=\"%TYPE{default=""}%\"}$percnt' style='color:$fadeRGB(%TAGCLOUD_START{default="111,169,255"}%,%TAGCLOUD_END{default="0,89,224"}%);' class='solrFacetValue' name='tag_$term' value='$term'>$term</a></span>"
  footer="</div>"
  group="<strong>$group</strong>&nbsp;"
  split="\s*,\s*"
  buckets="25"
  offset="13"
  warn="off"
  min="%MIN{default="0"}%"
}%
</noautolink>%STOPINCLUDE%

%STARTSECTION{"search"}%<!-- -->
%SOLRSEARCH{
  "%keywords%"
  id="solrtagcloud1"
  sort="date desc"
  type="edismax"
  fields=""
  web="%theweb%"
  filter="%filter% %IF{"$RECENCY != 'all'"
    then="$percntSOLRSEARCH{\"%keywords%\"
      sort=\"date desc\"
      type=\"edismax\"
      fields=\"id\"
      web=\"%theweb%\"
      filter=\"%filter%\"
      rows=\"%RECENCY{default="100"}%\"
      format=\"$id\"
      separator=\" OR \"
      header=\"id:(\"
      footer=\")\"
    }$percnt"}%"
  facets="tag"
  facetlimit="%limit%"
  rows="30"
}%<!--  -->%ENDSECTION{"search"}%

Test

%SOLRSEARCH{ " " id="solrtagcloud1" sort="date desc" type="dismax" fields="" web="" filter="type:topic web:

" facets="tag" facetlimit="100" rows="100" }% %TAGCLOUD{ terms="%SOLRFORMAT{ "solrtagcloud1" format_tag="$key:$count" separator_tag=", " }%" header="
" format="$term" footer="
" group="$group " split="\s*,\s*" buckets="20" offset="11" warn="off" min="1" }%

Calls to 'RenderSolrTagCloud'

Copyright

© 2006-2013 Michael Daum http://michaeldaumconsulting.com

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For more details read the LICENSE.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Warning: Can't find topic Applications/ClassificationApp.WebLeftBarExample

Das Urheberrecht © liegt bei den mitwirkenden Autoren. Alle Inhalte dieser Kollaborations-Plattform sind Eigentum der Autoren.