Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now aimed at CKAN 1.8a as of today - i.e. 94caef8e856.

  • Loading branch information...
commit 6a05bbc2a3f99f3d997abc457bd98030e5dec602 1 parent 956b27e
@davidread davidread authored
View
3  ckanext/dgu/controllers/data.py
@@ -29,8 +29,10 @@ def index(self):
# package search
context = {'model': model, 'session': model.Session,
'user': c.user or c.author}
+ fq = 'capacity:"public"'
data_dict = {
'q':'*:*',
+ 'fq':fq,
'facet.field':g.facets,
'rows':0,
'start':0,
@@ -38,6 +40,7 @@ def index(self):
query = ckan.logic.get_action('package_search')(context,data_dict)
c.package_count = query['count']
c.facets = query['facets']
+ c.search_facets = query['search_facets']
# group search
data_dict = {'order_by': 'packages', 'all_fields': 1}
View
4 ckanext/dgu/plugin.py
@@ -3,7 +3,7 @@
from logging import getLogger
-from ckan.lib.helpers import flash_notice, _flash
+from ckan.lib.helpers import flash_notice
from ckan.logic import NotFound
from ckan.plugins import implements, SingletonPlugin
from ckan.plugins import IRoutes
@@ -157,7 +157,7 @@ def before_commit(self, session):
except TypeError:
# Raised when there is no session registered, and this is
# the case when using the paster commands.
- log.warning('Failed to add a flash message due to a missing session')
+ log.warning('Failed to add a flash message due to a missing session: %s' % msg)
def before_map(self, map):
View
22 ckanext/dgu/theme/templates/_dgu_util.html
@@ -76,17 +76,17 @@ <h4 py:if="display_provider"><strong>Provider:</strong> ${provider.strip('"')}</
</ul>
<py:def function="dgu_facet_sidebar(code, limit=5, label=lambda n: n, title=h.facet_title, if_empty=None, count_label=lambda c: ' (%d)'%c)">
- <div py:if="if_empty is not None or len(h.facet_items(c, code, limit=limit))" class="facet-box">
+ <div py:if="if_empty is not None or len(h.unselected_facet_items(code, limit=limit))" class="facet-box">
<h4><img src="/images/arrow.png" class="arrow" /> ${title(code)}</h4>
<ul class="facet-options">
- <li py:for="name, count in h.facet_items(c, code, limit=limit)"
- py:if="not (code, name) in c.fields">
- <a href="${c.drill_down_url(**{code: name})}">
- <!--!<span py:if="'format' in code.lower()">${h.icon(h.format_icon(name))}</span>-->
- ${label(name)}</a>${count_label(count)}
+ <li py:for="facet_item in h.unselected_facet_items(code, limit=limit)"
+ py:if="not (code, facet_item['name']) in c.fields">
+ <a href="${c.drill_down_url(**{code: facet_item['name']})}">
+ <!--!<span py:if="'format' in code.lower()">${h.icon(h.format_icon(facet_item['name']))}</span>-->
+ ${label(facet_item['name'])}</a>${count_label(facet_item['count'])}
</li>
</ul>
- <p py:if="not len(h.facet_items(c, code, limit=limit))">${if_empty}</p>
+ <p py:if="not len(h.unselected_facet_items(code, limit=limit))">${if_empty}</p>
</div>
</py:def>
@@ -116,13 +116,13 @@ <h4 py:if="display_provider"><strong>Provider:</strong> ${provider.strip('"')}</
<!-- Create a nested list of UKLP filters -->
<div class="facet-box">
<h4><img src="/images/arrow.png" class="arrow"/> UK Location Dataset Type</h4>
- <ul py:if="len(h.facet_items(c, 'resource-type'))">
- ${facet_list_items('UKLP', label=lambda n: 'UKLP', if_empty='UK Location')}
+ <ul py:if="len(h.unselected_facet_items('resource-type'))">
+ ${facet_li('UKLP', label_function=lambda n: 'UKLP', if_empty='UK Location')}
<ul class="facet-options">
- ${facet_list_items('resource-type')}
+ ${facet_li('resource-type')}
</ul>
</ul>
- <p py:if="not len(h.facet_items(c, 'resource-type'))">There are no further type filters to apply.</p>
+ <p py:if="not len(h.unselected_facet_items('resource-type'))">There are no further type filters to apply.</p>
</div>
</div>
View
14 ckanext/dgu/theme/templates/data/index.html
@@ -33,11 +33,11 @@
<div id="tagcloud">
<?python
import random
- tags = h.facet_items(c, 'tags', limit=20)
+ tags = h.unselected_facet_items('tags', limit=20)
random.shuffle(tags)
?>
- <py:for each="tag_name, count in tags">
- <a rel="${count}" title="${count}" href="/data/search?tags=${tag_name}">${tag_name}</a>
+ <py:for each="tag_dict in tags">
+ <a rel="${tag_dict['count']}" title="${tag_dict['count']}" href="/data/search?tags=${tag_dict['name']}">${tag_dict['name']}</a>
</py:for>
</div>
<script type="text/javascript" charset="utf-8">
@@ -60,11 +60,11 @@
</div>
<h2>Publishers</h2>
<ul class="facet-options">
- <li py:for="name, count in h.facet_items(c, 'publisher', limit=10)">
- <a href="/data/search?publisher=${name}">${h.group_name_to_title(name)}</a> &nbsp;(${count})
+ <li py:for="publisher_dict in h.unselected_facet_items('publisher', limit=10)">
+ <a href="/data/search?publisher=${publisher_dict['name']}">${h.group_name_to_title(publisher_dict['name'])}</a> &nbsp;(${publisher_dict['count']})
</li>
</ul>
- <p py:if="not len(h.facet_items(c, 'publisher', limit=10))">No publishers found</p>
+ <p py:if="not len(h.unselected_facet_items('publisher', limit=1))">No publishers found</p>
</td>
<td class="gutter"></td>
<td class="boxed">
@@ -97,7 +97,7 @@
<li><a href="/contractfinder" class="js-tooltip" title="Search and read about all Government opportunities, tenders and contracts worth more than &pound;10,000.">Government contracts in full</a></li>
- <li><a href="/whoslobbying" class="js-tooltip" title="Find out which organisations and industries have met with Ministers from across Government departments.">Who's Lobbying</a> - Who ministers are meeting</li>
+ <li><a href="/whoslobbying" class="js-tooltip" title="Find out which organisations and industries have met with Ministers from across Government departments.">Who's Lobbying</a> - whom ministers are meeting</li>
<li><a href="/business_plans" class="js-tooltip" title="Check on the Government's progress on implementing its policies. See how every department is performing against its priorities.">Business plans</a></li>
View
112 ckanext/dgu/theme/templates/home/index.html
@@ -1,112 +0,0 @@
-<html xmlns:py="http://genshi.edgewall.org/"
- xmlns:i18n="http://genshi.edgewall.org/i18n"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- py:strip="">
-
- <xi:include href="../facets.html" />
- <py:def function="page_title">Welcome</py:def>
- <py:def function="body_class">hide-sidebar</py:def>
-
- <div py:match="//primarysidebar">
- <div id="block-block-77" class="block block-block">
- <h2>UK Location Map Based Search</h2>
- <div class="content">
- <p>PLACEHOLDER</p>
- </div>
- </div>
-
- <div class="content">
- <div class="view-header">
- <h2 class="title">Popular tags</h2>
- <div id="tagcloud">
- <?python
- import random
- tags = h.facet_items(c, 'tags', limit=20)
- random.shuffle(tags)
- ?>
- <py:for each="tag_name, count in tags">
- <a class="tag" rel="${count}" title="${count}" href="/dataset?tags=${tag_name}">${tag_name}</a>
- </py:for>
- </div>
- <a href="/tags" class="viewall">View all tags</a>
- </div>
-
- </div>
-
- <div id="login-side">
- <div class="view-header">
- <h2 class="title">Login</h2>
- </div>
- <a href="${h.url_for(controller='user', action='login')}">Log-in as publisher</a><br/>
- <a href="${h.url_for(controller='user', action='register')}">Register as publisher</a>
- </div>
-
- </div>
-
- <div py:match="//div[@id='content']" id="content-top">
-
- <div>
- <h1 class="title">
- <img src="/images/1x1.gif" id="icon_page-title"/>
- Data
- </h1>
- </div>
- <div class="action-box">
- <div class="action-box-inner find">
- <form action="${h.url_for(controller='package', action='search')}" method="GET">
- <input name="q" type="text" maxlength="256" id="data-search" size="15" value="" title="Enter the terms you wish to search for." class="form-text" />
- </form>
- ${g.site_title} contains <a href="${h.url_for(controller='package', action='search')}">${c.package_count} datasets</a> that you can
- browse, learn about and download.
- </div>
- </div>
-
- <div id="content-bottom" class="region region-content_bottom">
-
- <div id="block-views-publishers-block_1">
- <div class="view view-publishers view-id-publishers view-display-id-block_1 view-dom-id-3 view-id-display-id-publishers-block_1">
- <div class="view-header">
- <h2 class="title">Browse by publisher</h2>
- <a href="/publisher" class="viewall">View all publishers</a>
- </div>
-
- <div class="view-content">
- <div py:for="name, count in h.facet_items(c, 'groups', limit=7)"
- class="views-row">
- <div class="views-field-title">
- <span class="field-content"><span class="field-content">
- <a href="${h.url_for(controller='ckanext.dgu.controllers.publisher:PublisherController', action='read', id=name)}">
- ${h.group_name_to_title(name)} (${count})
- </a>
- </span></span>
- </div>
- </div>
- </div>
-
- </div>
- </div>
-
- <div class="content">
- <div style="clear: both; background: url('/images/gradient_heading.png') repeat-x; border-radius: 3px 3px 3px 3px; overflow: hidden; padding: 0; width: auto; height:30px;">
- <h2 style="font-size: 1.4em;">Developers</h2>
- </div>
- <p class="p1">You can also access this catalogue via the <a title="API" href="${g.site_url}">API</a> or download it as a&nbsp;<a title="CSV/JSON Dump" href="${g.site_url}/dump">CSV/JSON dump</a>.</p>
- </div>
- </div>
- </div>
- <head py:match="head">
- ${select('*')}
- <script type="text/javascript" src="${g.site_url}/scripts/vendors/jquery.tagcloud.js"></script>
- <script type="text/javascript" charset="utf-8">
- $(document).ready(function(){
- $.fn.tagcloud.defaults = {
- size: {start: 8, end: 18, unit: "pt"},
- color: {start: '#6bb247', end: '#000'}
- };
- $("#tagcloud a").tagcloud();
- });
- </script>
- </head>
- <xi:include href="layout.html" />
-</html>
-
View
30 ckanext/dgu/theme/templates/layout_base.html
@@ -59,7 +59,7 @@
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.chosen/0.9.7/chosen.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.placeholder/jquery.placeholder.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jqueryui/1.8.14/jquery-ui.min.js')}"></script>
- <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/bootstrap/2.0.2/bootstrap.min.js')}"></script>
+ <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/bootstrap/2.0.3/bootstrap.min.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/dgu.js')}"></script>
<py:if test="defined('optional_head')">
@@ -159,7 +159,7 @@
</div>
<!-- Flash Messages -->
- <py:with vars="messages = list(h._flash.pop_messages())">
+ <py:with vars="messages = list(h.flash.pop_messages())">
<div class="flash-messages container">
<div class="alert ${m.category}" py:for="m in messages">
${h.literal(m)}
@@ -258,8 +258,10 @@
CKAN.plugins.push('storage');
</py:if>
CKAN.SITE_URL = '${h.url('/')}';
+ CKAN.SITE_URL_NO_LOCALE = '${h.url('/', locale='default')}';
// later use will add offsets with leading '/' so ensure no trailing slash
CKAN.SITE_URL = CKAN.SITE_URL.replace(/\/$/, '');
+ CKAN.SITE_URL_NO_LOCALE = CKAN.SITE_URL_NO_LOCALE.replace(/\/$/, '');
$(document).ready(function() {
var ckan_user = '${c.user}';
if (ckan_user) {
@@ -274,6 +276,30 @@
});
</script>
+ <py:if test="h.asbool(config.get('ckan.tracking_enabled', 'false'))">
+ <script type="text/javascript">
+ $(function (){
+ // Tracking
+ var url = location.pathname;
+ // remove any site root from url
+ url = url.substring(CKAN.SITE_URL.length, url.length - 1);
+ $.ajax({url : CKAN.SITE_URL_NO_LOCALE + '/_tracking',
+ type : 'POST',
+ data : {url:url, type:'page'},
+ timeout : 300 });
+ $('a.resource-url-analytics').click(function (e){
+ var url = $(e.target).closest('a').attr('href');
+ $.ajax({url : CKAN.SITE_URL_NO_LOCALE + '/_tracking',
+ data : {url:url, type:'resource'},
+ type : 'POST',
+ complete : function () {location.href = url;},
+ timeout : 30});
+ e.preventDefault();
+ });
+ });
+ </script>
+ </py:if>
+
<py:if test="defined('optional_footer')">
${optional_footer()}
</py:if>
View
1  ckanext/dgu/theme/templates/package/edit.html
@@ -11,6 +11,7 @@
<script>
var form_errors = ${c.errors_json};
var publishers = ${c.publishers_json};
+ var resources_json = ${h.literal(c.resources_json)};
</script>
</py:def>
View
8 ckanext/dgu/theme/templates/package/layout.html
@@ -124,7 +124,7 @@
<py:match path="minornavigation" py:if="c.pkg">
<ul class="nav nav-pills">
- <li class="${'active' if c.action=='read' else ''}">${h.subnav_link(c, h.icon('package') + _('View'), controller='package', action='read', id=c.pkg.name)}</li>
+ <li class="${'active' if c.action=='read' else ''}">${h.subnav_link(h.icon('package') + _('View'), controller='package', action='read', id=c.pkg.name)}</li>
<py:choose test="len(c.pkg_dict.get('resources', []))==0 and not h.check_access('package_update',{'id':c.pkg.id})">
<py:when test="True">
<li class="disabled">
@@ -144,15 +144,15 @@
</li>
</py:otherwise>
</py:choose>
- <li class="${'active' if c.action=='history' else ''}">${h.subnav_link(c, h.icon('page_stack') + _('History'), controller='package', action='history', id=c.pkg.name)}</li>
+ <li class="${'active' if c.action=='history' else ''}">${h.subnav_link(h.icon('page_stack') + _('History'), controller='package', action='history', id=c.pkg.name)}</li>
<py:if test="h.check_access('package_update',{'id':c.pkg.id})">
<li class="divider">|</li>
<li class="${'active' if c.action=='edit' else ''}">
- ${h.subnav_link(c, h.icon('package_edit') + _('Edit'), controller='package', action='edit', id=c.pkg.name)}
+ ${h.subnav_link(h.icon('package_edit') + _('Edit'), controller='package', action='edit', id=c.pkg.name)}
</li>
</py:if>
<li class="${'active' if c.action=='authz' else ''}" py:if="h.check_access('package_edit_permissions',{'id':c.pkg.id})">
- ${h.subnav_link(c, h.icon('lock') + _('Authorization'), controller='package', action='authz', id=c.pkg.name)}
+ ${h.subnav_link(h.icon('lock') + _('Authorization'), controller='package', action='authz', id=c.pkg.name)}
</li>
</ul>
</py:match>
View
1  ckanext/dgu/theme/templates/package/new.html
@@ -7,6 +7,7 @@
<script>
var form_errors = ${c.errors_json};
var publishers = ${c.publishers_json};
+ var resources_json = ${h.literal(c.resources_json)};
</script>
</py:def>
View
30 ckanext/dgu/theme/templates/package/resource_read.html
@@ -12,13 +12,21 @@
py:strip="">
<xi:include href="../_snippet/data-api-help.html" />
+ <xi:include href="../snippets/data-viewer-embed-dialog.html" />
+
<xi:include href="sidebar.html"/>
<py:def function="optional_head">
<!-- data preview -->
+ <link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/leaflet/0.3.1/leaflet.css')}" />
+ <!--[if lte IE 8]>
+ <link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/leaflet/0.3.1/leaflet.ie.css')}" />
+ <![endif]-->
<link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/recline/css/data-explorer.css')}" />
- <link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/recline/css/graph-flot.css')}" />
+ <link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/recline/css/graph.css')}" />
+ <link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/recline/css/map.css')}" />
+ <link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/recline/css/grid.css')}" />
<style type="text/css">
.recline-query-editor form, .recline-query-editor .text-query {
height: 28px;
@@ -27,10 +35,20 @@
margin: 0;
padding: 0;
}
+ /* needed for Chrome but not FF */
+ .header .recline-query-editor .add-on {
+ margin-left: -27px;
+ }
+
+ /* needed for FF but not chrome */
+ .header .recline-query-editor .input-prepend {
+ vertical-align: top;
+ }
</style>
<!-- /data preview -->
<script type="text/javascript">
var preload_resource = ${h.literal(c.resource_json)};
+ <!--!var embedPath = "${g.site_url+h.url_for(controller='package', action='resource_embedded_dataviewer', id=c.package.id, resource_id=c.resource.id)}";-->
</script>
</py:def>
@@ -81,6 +99,8 @@
${data_api_help(c.datastore_api)}
</py:if>
+ ${data_viewer_embed_dialog()}
+
<div class="quick-info">
<div>
<h4 style="margin-bottom:0;">Last updated:</h4>
@@ -132,7 +152,11 @@ <h4 style="margin-bottom:0;">Licence:</h4>
</div>
<div class="resource-preview">
- <h3>Preview</h3>
+ <div class="preview-header">
+ <h3>Preview</h3>
+ <a py:if="c.pkg.is_private" title="Cannot embed as resource is private." style="display: none;" class="btn disabled" data-toggle="modal" href=".modal-data-viewer-embed-dialog">Embed</a>
+ <a py:if="not c.pkg.is_private" style="display: none;" class="btn btn-primary" data-toggle="modal" href=".modal-data-viewer-embed-dialog">Embed</a>
+ </div>
<div id="ckanext-datapreview"></div>
</div>
@@ -160,6 +184,8 @@ <h4 style="margin-bottom:0;">Licence:</h4>
<!-- data preview -->
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.mustache/jquery.mustache.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/flot/0.7/jquery.flot.js')}"></script>
+ <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/flot/0.7/jquery.flot.js')}"></script>
+ <script type="text/javascript" src="${h.url_for_static('/scripts/vendor/leaflet/0.3.1/leaflet.js')}"></script>
<script src="${h.url_for_static('/scripts/vendor/recline/recline.js')}"></script>
</py:def>
View
2  ckanext/dgu/theme/templates/tag/index.html
@@ -37,7 +37,7 @@
${c.page.pager(q=c.q)}
<div class="clearfix"></div>
- ${tag_list_from_name(c.page.items)}
+ ${tag_list(c.page.items)}
${c.page.pager(q=c.q)}
</div>
View
6 ckanext/dgu/theme/templates/tag/read.html
@@ -3,13 +3,13 @@
xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip="">
- <py:def function="page_title">${c.tag['name']} - Tags</py:def>
- <py:def function="page_heading">Tag: ${c.tag['name']}</py:def>
+ <py:def function="page_title">${c.tag['display_name']} - Tags</py:def>
+ <py:def function="page_heading">Tag: ${c.tag['display_name']}</py:def>
<py:def function="content_class"><!--unboxed--></py:def>
<div py:match="content">
<div class="boxed">
- <span i18n:msg="count, tagname">There are ${len(c.tag['packages'])} dataset(s) tagged with <a class="tag">${c.tag['name']}</a>:</span>
+ <span i18n:msg="count, tagname">There are ${len(c.tag['packages'])} dataset(s) tagged with <a class="tag">${c.tag['display_name']}</a>:</span>
</div>
${package_list_from_dict(c.tag['packages'])}
</div>
View
187 config/solr/schema-1.4-dgu.xml
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<schema name="ckan" version="1.4"> <!-- DGU variant -->
+
+<types>
+ <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
+ <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>
+ <fieldtype name="binary" class="solr.BinaryField"/>
+ <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
+ <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
+
+ <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
+ <analyzer type="index">
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <!-- in this example, we will only use synonyms at query time
+ <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
+ -->
+ <!-- Case insensitive stop word removal.
+ add enablePositionIncrements=true in both the index and query
+ analyzers to leave a 'gap' for more accurate phrase queries.
+ -->
+ <filter class="solr.StopFilterFactory"
+ ignoreCase="true"
+ words="stopwords.txt"
+ enablePositionIncrements="true"
+ />
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
+ <filter class="solr.ASCIIFoldingFilterFactory"/>
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+ <filter class="solr.StopFilterFactory"
+ ignoreCase="true"
+ words="stopwords.txt"
+ enablePositionIncrements="true"
+ />
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
+ <filter class="solr.ASCIIFoldingFilterFactory"/>
+ </analyzer>
+ </fieldType>
+
+
+ <!-- A general unstemmed text field - good if one does not know the language of the field -->
+ <fieldType name="textgen" class="solr.TextField" positionIncrementGap="100">
+ <analyzer type="index">
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+ <filter class="solr.StopFilterFactory"
+ ignoreCase="true"
+ words="stopwords.txt"
+ enablePositionIncrements="true"
+ />
+ <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
+</types>
+
+
+<fields>
+ <field name="index_id" type="string" indexed="true" stored="true" required="true" />
+ <field name="id" type="string" indexed="true" stored="true" required="true" />
+ <field name="site_id" type="string" indexed="true" stored="true" required="true" />
+ <field name="title" type="text" indexed="true" stored="true" />
+ <field name="entity_type" type="string" indexed="true" stored="true" omitNorms="true" />
+ <field name="state" type="string" indexed="true" stored="true" omitNorms="true" />
+ <field name="name" type="string" indexed="true" stored="true" omitNorms="true" />
+ <field name="revision_id" type="string" indexed="true" stored="true" omitNorms="true" />
+ <field name="version" type="string" indexed="true" stored="true" />
+ <field name="url" type="string" indexed="true" stored="true" omitNorms="true" />
+ <field name="ckan_url" type="string" indexed="true" stored="true" omitNorms="true" />
+ <field name="download_url" type="string" indexed="true" stored="true" omitNorms="true" />
+ <field name="notes" type="text" indexed="true" stored="true"/>
+ <field name="author" type="textgen" indexed="true" stored="true" />
+ <field name="author_email" type="textgen" indexed="true" stored="true" />
+ <field name="maintainer" type="textgen" indexed="true" stored="true" />
+ <field name="maintainer_email" type="textgen" indexed="true" stored="true" />
+ <field name="license" type="string" indexed="true" stored="true" />
+ <field name="license_id" type="string" indexed="true" stored="true" />
+ <field name="ratings_count" type="int" indexed="true" stored="false" />
+ <field name="ratings_average" type="float" indexed="true" stored="false" />
+ <field name="tags" type="string" indexed="true" stored="true" multiValued="true"/>
+ <field name="groups" type="string" indexed="true" stored="true" multiValued="true"/>
+ <field name="group_titles" type="text" indexed="true" stored="true" multiValued="true"/>
+
+ <field name="capacity" type="string" indexed="true" stored="true" multiValued="false"/>
+
+ <field name="res_description" type="textgen" indexed="true" stored="true" multiValued="true"/>
+ <field name="res_format" type="string" indexed="true" stored="true" multiValued="true"/>
+ <field name="res_url" type="string" indexed="true" stored="true" multiValued="true"/>
+
+ <!-- catchall field, containing all other searchable text fields (implemented
+ via copyField further on in this schema -->
+ <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
+ <field name="urls" type="text" indexed="true" stored="false" multiValued="true"/>
+
+ <field name="depends_on" type="text" indexed="true" stored="false" multiValued="true"/>
+ <field name="dependency_of" type="text" indexed="true" stored="false" multiValued="true"/>
+ <field name="derives_from" type="text" indexed="true" stored="false" multiValued="true"/>
+ <field name="has_derivation" type="text" indexed="true" stored="false" multiValued="true"/>
+ <field name="links_to" type="text" indexed="true" stored="false" multiValued="true"/>
+ <field name="linked_from" type="text" indexed="true" stored="false" multiValued="true"/>
+ <field name="child_of" type="text" indexed="true" stored="false" multiValued="true"/>
+ <field name="parent_of" type="text" indexed="true" stored="false" multiValued="true"/>
+ <field name="views_total" type="int" indexed="true" stored="false"/>
+ <field name="views_recent" type="int" indexed="true" stored="false"/>
+ <field name="resources_accessed_total" type="int" indexed="true" stored="false"/>
+ <field name="resources_accessed_recent" type="int" indexed="true" stored="false"/>
+
+
+ <field name="metadata_created" type="date" indexed="true" stored="true" multiValued="false"/>
+ <field name="metadata_modified" type="date" indexed="true" stored="true" multiValued="false"/>
+
+ <field name="indexed_ts" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
+
+ <field name="publisher" type="string" indexed="true" stored="true" multiValued="false"/>
+ <field name="parent_publishers" type="string" indexed="true" stored="true" multiValued="true"/>
+
+ <!-- Copy the title field into title_string, and treat as a string
+ (rather than text type). This allows us to sort on the title_string -->
+ <field name="title_string" type="string" indexed="true" stored="false" />
+
+ <field name="data_dict" type="string" indexed="false" stored="true" />
+
+ <dynamicField name="extras_*" type="text" indexed="true" stored="true" multiValued="false"/>
+ <dynamicField name="*" type="string" indexed="true" stored="false"/>
+</fields>
+
+<uniqueKey>index_id</uniqueKey>
+<defaultSearchField>text</defaultSearchField>
+<solrQueryParser defaultOperator="AND"/>
+
+<copyField source="url" dest="urls"/>
+<copyField source="ckan_url" dest="urls"/>
+<copyField source="download_url" dest="urls"/>
+<copyField source="res_url" dest="urls"/>
+<copyField source="extras_*" dest="text"/>
+<copyField source="urls" dest="text"/>
+<copyField source="name" dest="text"/>
+<copyField source="title" dest="text"/>
+<copyField source="text" dest="text"/>
+<copyField source="license" dest="text"/>
+<copyField source="notes" dest="text"/>
+<copyField source="tags" dest="text"/>
+<copyField source="groups" dest="text"/>
+<copyField source="group_titles" dest="text"/>
+<copyField source="res_description" dest="text"/>
+<copyField source="res_format" dest="text"/>
+<copyField source="maintainer" dest="text"/>
+<copyField source="author" dest="text"/>
+
+</schema>

0 comments on commit 6a05bbc

Please sign in to comment.
Something went wrong with that request. Please try again.