소스 검색

added 'year descending' to sort options

main
Simon Bowie 2 년 전
부모
커밋
35a5ed2146
3개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  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 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

@@ -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…
취소
저장