RenderKnownTagsSolr
returns a list of known tags using SolrPlugin

02 May 2019 - 06:19 | Version 1 |

Documentation

This function is used in the tag editor's autocompletion textboxlist to return a set of matching tags given the prefix in the url param q. See the classificationplugin.tmpl template file. This in essence is functionally equivalent to RenderKnownTags however is using SolrPlugin if installed for better performance.

Parameters
  • TAG: pattern of tags to include, defaults to a neutral filter; this pattern is to match the prefix of the tag name
  • LIMIT: maximum number of categories to return, defaults to 10
  • THEWEB: web from which to extract category information, defaults to BASEWEB

Implementation

%STARTINCLUDE%%SOLRSEARCH{
  web="%THEWEB{default="%BASEWEB%"}%"
  facetlimit="tag=%LIMIT{default="10"}%"
  field="none"
  facets="tag"
  facetprefix="%TAG{default=""}%"
  facetsort="index"
  header_tag="[$n"
  format_tag="{\"value\":\"$key\"}"
  separator_tag=",$n"
  footer_tag="$n]"
}%%STOPINCLUDE%

Test

[
{"value":"AMS"},
{"value":"Anatomy"},
{"value":"Assessment"},
{"value":"BarBaz"},
{"value":"Breathing"},
{"value":"CNS"},
{"value":"Eyes"},
{"value":"FooBar"},
{"value":"HAZMAT"},
{"value":"History"}
]

Copyright

© 2006-2019 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.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Middle Fork Home Wiki? Send feedback
Syndicate this site RSS