Browse Source

added 'year descending' to sort options

main
Simon Bowie 2 years ago
parent
commit
35a5ed2146
3 changed files with 5 additions and 3 deletions
  1. +2
    -1
      site/public/index.php
  2. +2
    -1
      site/public/search.php
  3. +1
    -1
      site/solr.php

+ 2
- 1
site/public/index.php View File

@@ -53,7 +53,8 @@ $cores = array("active", "expanding", "invisible", "multispecies", "pissing", "s
sort by:
<select name="sort" id="sort">
<option value="relevance">relevance</option>
<option value="year">year</option>
<option value="year desc">year descending</option>
<option value="year asc">year ascending</option>
</select>
<input type="submit" id="submit" value="search">
</form>

+ 2
- 1
site/public/search.php View File

@@ -33,7 +33,8 @@ include '../text_functions.php';
sort by:
<select name="sort" id="sort" onchange="this.form.submit()">
<option value="relevance" <?php if($_POST["sort"] == 'relevance') echo "selected"; ?>>relevance</option>
<option value="year" <?php if($_POST["sort"] == 'year') echo "selected"; ?>>year</option>
<option value="year desc" <?php if($_POST["sort"] == 'year desc') echo "selected"; ?>>year descending</option>
<option value="year asc" <?php if($_POST["sort"] == 'year asc') echo "selected"; ?>>year ascending</option>
</select>
<noscript>
<input type="submit" class="btn btn-default" value="Set" />

+ 1
- 1
site/solr.php View File

@@ -8,7 +8,7 @@ function solr_search($search, $core, $sort){
}
else{
// Assemble a query string to send to Solr. This uses the Solr hostname from config.env. Solr's query syntax can be found at many sites including https://lucene.apache.org/solr/guide/6_6/the-standard-query-parser.html
$solrurl = 'http://' . $_ENV["SOLR_HOSTNAME"] . ':' . $_ENV["SOLR_PORT"] . '/solr/' . $core . '/select?q.op=OR&q=content%3A' . $search . '&wt=json&sort=' . $sort . '%20asc';
$solrurl = 'http://' . $_ENV["SOLR_HOSTNAME"] . ':' . $_ENV["SOLR_PORT"] . '/solr/' . $core . '/select?q.op=OR&q=content%3A' . $search . '&wt=json&sort=' . urlencode($sort);
}

// Perform Curl request on the Solr API

Loading…
Cancel
Save