| @@ -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> | |||
| @@ -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" /> | |||
| @@ -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 | |||