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

sort by: sort by:
<select name="sort" id="sort"> <select name="sort" id="sort">
<option value="relevance">relevance</option> <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> </select>
<input type="submit" id="submit" value="search"> <input type="submit" id="submit" value="search">
</form> </form>

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

sort by: sort by:
<select name="sort" id="sort" onchange="this.form.submit()"> <select name="sort" id="sort" onchange="this.form.submit()">
<option value="relevance" <?php if($_POST["sort"] == 'relevance') echo "selected"; ?>>relevance</option> <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> </select>
<noscript> <noscript>
<input type="submit" class="btn btn-default" value="Set" /> <input type="submit" class="btn btn-default" value="Set" />

+ 1
- 1
site/solr.php View File

} }
else{ 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 // 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 // Perform Curl request on the Solr API

Loading…
Cancel
Save