Commit eb2e5a23 authored by Romain Loth's avatar Romain Loth

docs view: prepare feature for remote search in abstracts (will be useful when...

docs view: prepare feature for remote search in abstracts (will be useful when we do abstract indexing in sql etc)
parent e906897e
......@@ -592,7 +592,7 @@ function Main_test(Data) {
// by default we always decide to search in the title
matchInTexts = [record.rawtitle]
// if box is checked we'll also search in the abstracts
// if box is checked we'll also search in the abstracts (todo: via ajax)
if (doAbstractsSearch) {
if (typeof record.hyperdata.abstract !== 'undefined') {
matchInTexts.push(record.hyperdata.abstract)
......@@ -768,7 +768,10 @@ function tidyAfterPageSet() {
$.ajax({
url: '/api/nodes?types[]=DOCUMENT&pagination_limit=-1&parent_id='
+ corpus_id
+'&fields[]=parent_id&fields[]=id&fields[]=name&fields[]=typename&fields[]=hyperdata',
+'&fields[]=parent_id&fields[]=id&fields[]=name&fields[]=typename&fields[]=hyperdata'
// +'&hyperdata_filter[]=title&hyperdata_filter[]=source&hyperdata_filter[]=language_iso2'
+'&hyperdata_filter[]=title&hyperdata_filter[]=source&hyperdata_filter[]=language_iso2&hyperdata_filter[]=abstract'
+'&hyperdata_filter[]=publication_year&hyperdata_filter[]=publication_month&hyperdata_filter[]=publication_day',
success: function(maindata){
// unfortunately favorites info is in a separate request (other nodes)
$.ajax({
......@@ -838,6 +841,10 @@ $.ajax({
rec.hyperdata.publication_day
)
// and a bool property for remote search results
// (will be updated by ajax)
rec.matched_remote_search = false // TODO use it
}
AjaxRecords = maindata.records; // backup-ing in global variable!
......
......@@ -21,12 +21,12 @@
<div class="col-md-3 col-md-offset-2">
<div id="monthly-move-chart">
<center>
Select a time range in the chart with blue bars to zoom in
<p align="center">
Select a time range in the chart with blue bars to zoom in
<p align="center">
<!--<a class="btn btn-xs btn-default" role="button" href="/chart/corpus/{{ corpus.id }}/data.csv">Save</a>-->
<a class="btn btn-xs btn-default" href="javascript:volumeChart.filterAll();dc.redrawAll();">Reset</a></p>
<div class="clearfix"></div>
<a class="btn btn-xs btn-default" href="javascript:volumeChart.filterAll();dc.redrawAll();">Reset</a>
</p>
<div class="clearfix"></div>
</center>
</div>
......@@ -68,10 +68,14 @@
<span style="font-size:70%;">
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<!-- Used by the #doubleSearch associated function -->
<input title="Search in Titles" id="searchTI" name="searchTI" type="checkbox" checked onclick="return false">TI&nbsp;
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<input title="Search in Abstracts" id="searchAB" name="searchAB" type="checkbox">AB
</span>&nbsp;&nbsp;
<input title="Search in Titles" id="searchTI" name="searchTI" type="checkbox" checked onclick="return false">
TI&nbsp;
</input>
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<input title="Search in Abstracts" id="searchAB" name="searchAB" type="checkbox">
AB&nbsp;&nbsp;
</input>
</span>
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<select id="docFilter" name="docFilter">
<option value="filter_all">All</option>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment