summaryrefslogtreecommitdiff
path: root/htroot/ConfigSearchPage_p.html
diff options
context:
space:
mode:
authorMichael Peter Christen <mc@yacy.net>2015-03-02 04:30:10 +0100
committerMichael Peter Christen <mc@yacy.net>2015-03-02 04:30:10 +0100
commit535f1ebe3b3f896d9c813d7fe788f86de3d68564 (patch)
treeea2ff910d61d4c63f791af2027c8bf28913297cf /htroot/ConfigSearchPage_p.html
parentc3aadcf8999e8c5792160364dc6b69c8ca14119b (diff)
added a new way of content browsing in search results:
- date navigation The date is taken from the CONTENT of the documents / web pages, NOT from a date submitted in the context of metadata (i.e. http header or html head form). This makes it possible to search for documents in the future, i.e. when documents contain event descriptions for future events. The date is written to an index field which is now enabled by default. All documents are scanned for contained date mentions. To visualize the dates for a specific search results, a histogram showing the number of documents for each day is displayed. To render these histograms the morris.js library is used. Morris.js requires also raphael.js which is now also integrated in YaCy. The histogram is now also displayed in the index browser by default. To select a specific range from a search result, the following modifiers had been introduced: from:<date> to:<date> These modifiers can be used separately (i.e. only 'from' or only 'to') to describe an open interval or combined to have a closed interval. Both dates are inclusive. To select a specific single date only, use the 'to:' - modifier. The histogram shows blue and green lines; the green lines denot weekend days (saturday and sunday). Clicking on bars in the histogram has the following reaction: 1st click: add a from:<date> modifier for the date of the bar 2nd click: add a to:<date> modifier for the date of the bar 3rd click: remove from and date modifier and set a on:<date> for the bar When the on:<date> modifier is used, the histogram shows an unlimited time period. This makes it possible to click again (4th click) which is then interpreted as a 1st click again (sets a from modifier). The display feature is NOT switched on by default; to switch it on use the /ConfigSearchPage_p.html servlet.
Diffstat (limited to 'htroot/ConfigSearchPage_p.html')
-rw-r--r--htroot/ConfigSearchPage_p.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/htroot/ConfigSearchPage_p.html b/htroot/ConfigSearchPage_p.html
index 07117f677..366f5b290 100644
--- a/htroot/ConfigSearchPage_p.html
+++ b/htroot/ConfigSearchPage_p.html
@@ -174,9 +174,46 @@
</div>
</fieldset>
</div>
+
<!-- the search result -->
<div style="float: left;">
+
+
+ <input type="checkbox" name="search.navigation.date" value="true" #(search.navigation.date)#::checked="checked" #(/search.navigation.date)# /> Date Navigation
+<link rel="stylesheet" href="/env/morris.css">
+<script src="/js/raphael-min.js"></script>
+<script src="/js/morris.js"></script>
+<div id="graph" style="height:200px"></div>
+<script>
+var solr= $.getJSON("http://localhost:8090/solr/collection1/select?q=*:*&defType=edismax&start=0&rows=0&wt=json&facet=true&facet.field=dates_in_content_dts&facet.sort=index", function(data) {
+ dates_in_content_dts = data.facet_counts.facet_fields.dates_in_content_dts;
+ var parsed = [];
+ for (var i = 0; i < dates_in_content_dts.length; i = i + 2) {
+ var date = dates_in_content_dts[i];
+ var count = dates_in_content_dts[i + 1];
+ if (date && count) {parsed[parsed.length] = {x: date,y: count};};
+ };
+ if (parsed.length > 0) Morris.Bar({
+ element: 'graph',
+ data: parsed,
+ xkey: 'x',
+ ykeys: ['y'],
+ labels: ['number of documents about this date'],
+ yLabelFormat: function (y) { return y.toString() + ' docs'; },
+ barColors: function (row, series, type) {
+ var d = new Date(row.label);
+ if (d.getDay() === 6) return '#4aaf46'; //saturday
+ if (d.getDay() === 0) return '#4aaf46'; //sunday
+ return '#3574c0';
+ },
+ hideHover: 'false'
+ }).on('click', function(i, row) {
+ console.log(i, row);
+ });
+});
+</script>
+
<fieldset>
<div class="searchresults">
<h4 class="linktitle">