Skip to content

Instantly share code, notes, and snippets.

View dbolser's full-sized avatar
💭
Reversing the polarity

Dan Bolser dbolser

💭
Reversing the polarity
View GitHub Profile
<?php
define('VBULL_EXTENSION_VERSION', '2.1.2');
# if we're not in the mediawiki framework just die
if ( !defined( 'MEDIAWIKI' ) ) die();
# extension credits
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
I've been playing with the 'apachesolr_examples' project [1] to get apachesolr [2] to search an 'external' (non-Drupal content derived) Solr index. This is working great, and even allows me to build facets for the fields of my choice, which show up nicely as blocks on the search page.
However, when I subsequently install the Current Search Blocks (CSB) module in the Facet API project, the CSB seems to 'clobber' the facet blocks. The blocks disappear from the admin/structure/block list (and from the search page). Weirdly, the facet config tab of the external index changes from listing only those facets defined in the code to the 'full' set of facetable fields in the 'default' apachesolr index schema.
[1] http://drupal.org/project/apachesolr_examples
[2] http://drupal.org/project/apachesolr
STEPS TO REPRODUCE
* Start with a new Drupal install.
/**
* Implements hook_facetapi_facet_info().
* Provides the definitions for the extra facets.
*
* @param array $searcher_info
* The definition of the searcher that facets are being collected for.
*
* @return array
* An associative array keyed by unique name of the facet.
Bradi1g00607.1 Genomic putative protein - ID=Bradi1g00607.1;Parent=Bradi1g00607 http://mips.helmholtz-muenchen.de/plant/brachypodium/reportsjsp/geneticElement.jsp?gene=Bradi1g00607.1
Bradi1g00880.1 Genomic putative protein - ID=Bradi1g00880.1;Parent=Bradi1g00880 http://mips.helmholtz-muenchen.de/plant/brachypodium/reportsjsp/geneticElement.jsp?gene=Bradi1g00880.1
Bradi1g01350.1 Genomic putative protein - ID=Bradi1g01350.1;Parent=Bradi1g01350 http://mips.helmholtz-muenchen.de/plant/brachypodium/reportsjsp/geneticElement.jsp?gene=Bradi1g01350.1
Bradi1g01730.3 Genomic putative protein - ID=Bradi1g01730.3;Parent=Bradi1g01730 http://mips.helmholtz-muenchen.de/plant/brachypodium/reportsjsp/geneticElement.jsp?gene=Bradi1g01730.3
Bradi1g02300.1 Genomic putative protein - ID=Bradi1g02300.1;Parent=Bradi1g02300 http://mips.helmholtz-muenchen.de/plant/brachypodium/reportsjsp/geneticElement.jsp?gene=Bradi1g02300.1
Bradi1g03440.1 Genomic S-adenosylmethionine-dependent methyltransferase activity, protein methyltransferase a
Ancestry (Worldwide, Neanderthal and population markers)
Cholesterol
Eye colour
Smell perception
Taste perception
Blood glucose
Muscle performance
Blood pressure
Body mass index (BMI)
Blood type
sub best_hit {
## Score
$b->score <=> $a->score ||
## Identity
$b->percent_id <=> $a->percent_id ||
## Length on query sequence
(($b->hend-$b->hstart) <=>
($a->hend-$a->hstart)) ||
> explain select * FROM dna INNER JOIN seq_region USING (seq_region_id) WHERE coord_system_id = 3;
+----+-------------+------------+--------+----------------+---------+---------+-------------------------------------------
----------+------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref
| rows | Extra |
+----+-------------+------------+--------+----------------+---------+---------+-------------------------------------------
----------+------+-------+
| 1 | SIMPLE | seq_region | ref | PRIMARY,cs_idx | cs_idx | 4 | const
| 2174 | |
| 1 | SIMPLE | dna | eq_ref | PRIMARY | PRIMARY | 4 | brassica_rapa_core_13_66_1.seq_region.seq_region_id | 1 | |
CASE
#
WHEN RECEIVED RLIKE '^[0-9]{4}$'
THEN STR_TO_DATE(RECEIVED, '%Y')
#
WHEN RECEIVED RLIKE '^30-JUN-[0-9]{2}$'
THEN STR_TO_DATE(RIGHT(RECEIVED, 2), '%y')
#
WHEN STR_TO_DATE(RECEIVED, '%M %Y')
{{#vardefine:coord|{{#geocode:{{{address|Largo Gerolamo Gaslini, 5}}},{{{City|Genova}}},{{{country|Italy}}}|google}}
}}
{{#set: Has coordinate = {{#var:coord}} }}
<div style="float: right; width:45%">
{{#ask:
[[Category: Laboratory]]
|?Has coordinate
| format = map
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
use Encode;
use MediaWiki::API; # our $VERSION = "0.37";