lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1095950 - in /lucene/dev/trunk/solr: ./ example/solr/conf/ example/solr/conf/velocity/
Date Fri, 22 Apr 2011 15:39:07 GMT
Author: yonik
Date: Fri Apr 22 15:39:07 2011
New Revision: 1095950

URL: http://svn.apache.org/viewvc?rev=1095950&view=rev
Log:
SOLR-2383: /browse improvements: generalize range and date facet display

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml
    lucene/dev/trunk/solr/example/solr/conf/velocity/VM_global_library.vm
    lucene/dev/trunk/solr/example/solr/conf/velocity/facet_dates.vm
    lucene/dev/trunk/solr/example/solr/conf/velocity/facet_ranges.vm
    lucene/dev/trunk/solr/example/solr/conf/velocity/main.css
    lucene/dev/trunk/solr/example/solr/conf/velocity/query.vm

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1095950&r1=1095949&r2=1095950&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Fri Apr 22 15:39:07 2011
@@ -134,6 +134,11 @@ New Features
 * SOLR-1709: Distributed support for Date and Numeric Range Faceting
   (Peter Sturge, David Smiley, hossman)
 
+* SOLR-2383: /browse improvements: generalize range and date facet display
+  (Jan Høydahl via yonik)
+
+
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml?rev=1095950&r1=1095949&r2=1095950&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml (original)
+++ lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml Fri Apr 22 15:39:07 2011
@@ -774,6 +774,7 @@
        <str name="q.alt">*:*</str>
        <str name="rows">10</str>
        <str name="fl">*,score</str>
+
        <str name="mlt.qf">
          text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
        </str>
@@ -792,6 +793,8 @@
        <int name="facet.range.start">0</int>
        <int name="facet.range.end">600</int>
        <int name="facet.range.gap">50</int>
+       <str name="facet.range">popularity</str>
+       <int name="f.popularity.facet.range.gap">3</int>
        <str name="facet.range.other">after</str>
        <str name="facet.date">manufacturedate_dt</str>
        <str name="facet.date.start">NOW/YEAR-10YEARS</str>

Modified: lucene/dev/trunk/solr/example/solr/conf/velocity/VM_global_library.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/conf/velocity/VM_global_library.vm?rev=1095950&r1=1095949&r2=1095950&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/conf/velocity/VM_global_library.vm (original)
+++ lucene/dev/trunk/solr/example/solr/conf/velocity/VM_global_library.vm Fri Apr 22 15:39:07
2011
@@ -88,13 +88,13 @@
     <ul>
     #foreach ($facet in $field)
       #set($theDate = $date.toDate("yyyy-MM-dd'T'HH:mm:ss'Z'", $facet.key))
-      #set($value = '["' + $facet.key + '" TO "' + $facet.key + $gap + '"]')
+      #set($value = '["' + $facet.key + '" TO "' + $facet.key + $gap + '"}')
 
       #set($facetURL = "#url_for_facet_date_filter($fieldName, $value)")
       #if ($facetURL != '')
         #if ($facet.key != "gap" && $facet.key != "start" && $facet.key !=
"end" && $facet.key != "before" && $facet.key != "after")
 
-          <li><a href="$facetURL">$date.format('MMM yyyy', $theDate)</a>
($facet.value)</li>
+          <li><a href="$facetURL">$date.format('MMM yyyy', $theDate) $gap</a>
($facet.value)</li>
         #end
         #if ($facet.key == "before" && $facet.value > 0)
           <li><a href="$facetURL">Before</a> ($facet.value)</li>
@@ -113,20 +113,20 @@
   <span class="facet-field">$display</span>
     <ul>
     #if($before && $before != "")
-      #set($value = "[* TO " + $start + "]")
+      #set($value = "[* TO " + $start + "}")
       #set($facetURL = "#url_for_facet_range_filter($fieldName, $value)")
       <li><a href="$facetURL">Less than $start</a> ($before)</li>
     #end
     #foreach ($facet in $field)
       #set($rangeEnd = $math.add($facet.key, $gap))
-      #set($value = "[" + $facet.key + " TO " + $rangeEnd + "]")
+      #set($value = "[" + $facet.key + " TO " + $rangeEnd + "}")
       #set($facetURL = "#url_for_facet_range_filter($fieldName, $value)")
       #if ($facetURL != '')
-        <li><a href="$facetURL">$facet.key</a> ($facet.value)</li>
+        <li><a href="$facetURL">$facet.key - $rangeEnd</a> ($facet.value)</li>
       #end
     #end
-    #if($end && $end != "")
-      #set($value = "[" + $end + " TO *]")
+    #if($end && $end != "" && $after > 0)
+      #set($value = "[" + $end + " TO *}")
       #set($facetURL = "#url_for_facet_range_filter($fieldName, $value)")
       <li><a href="$facetURL">More than $math.toNumber($end)</a> ($after)</li>
     #end
@@ -180,4 +180,8 @@
       $v
     #end
   #end
-#end  
\ No newline at end of file
+#end  
+
+#macro(capitalize $name)
+  ${name.substring(0,1).toUpperCase()}${name.substring(1)}
+#end
\ No newline at end of file

Modified: lucene/dev/trunk/solr/example/solr/conf/velocity/facet_dates.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/conf/velocity/facet_dates.vm?rev=1095950&r1=1095949&r2=1095950&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/conf/velocity/facet_dates.vm (original)
+++ lucene/dev/trunk/solr/example/solr/conf/velocity/facet_dates.vm Fri Apr 22 15:39:07 2011
@@ -1,5 +1,9 @@
 ##TODO: Generically deal with all dates
 <h2 #annTitle("Facets generated by adding &facet.date= to the request")>Date Facets</h2>
       
-#set($field = $response.response.facet_counts.facet_dates.manufacturedate_dt)
-#set($gap = $response.response.facet_counts.facet_dates.manufacturedate_dt.gap)
-#display_facet_date($field, "Manufacture Date", "manufacturedate_dt", $gap)
+#foreach ($field in $response.response.facet_counts.facet_dates)
+	#set($name = $field.key)
+	#set($display = "#capitalize($name)")
+	#set($f = $field.value)
+	#set($gap = $field.value.gap)
+    #display_facet_date($f, $display, $name, $gap)
+#end
\ No newline at end of file

Modified: lucene/dev/trunk/solr/example/solr/conf/velocity/facet_ranges.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/conf/velocity/facet_ranges.vm?rev=1095950&r1=1095949&r2=1095950&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/conf/velocity/facet_ranges.vm (original)
+++ lucene/dev/trunk/solr/example/solr/conf/velocity/facet_ranges.vm Fri Apr 22 15:39:07 2011
@@ -1,10 +1,12 @@
 <h2 #annTitle("Facets generated by adding &facet.range= to the request")>Range
Facets</h2>
-#set($field = $response.response.facet_counts.facet_ranges.price.counts)
-#set($start = $response.response.facet_counts.facet_ranges.price.start)
-#set($end = $response.response.facet_counts.facet_ranges.price.end)
-#set($gap = $response.response.facet_counts.facet_ranges.price.gap)
-#set($before = $response.response.facet_counts.facet_ranges.price.before)
-#set($after = $response.response.facet_counts.facet_ranges.price.after)
-##TODO: Make this display the "range", not just the lower value
-##TODO: Have a generic way to deal with ranges
-#display_facet_range($field, "Price (in $)", "price", $start, $end, $gap, $before, $after)
+#foreach ($field in $response.response.facet_counts.facet_ranges)
+	#set($name = $field.key)
+	#set($display = "#capitalize($name)")
+	#set($f = $field.value.counts)
+	#set($start = $field.value.start)
+	#set($end = $field.value.end)
+	#set($gap = $field.value.gap)
+	#set($before = $field.value.before)
+	#set($after = $field.value.after)
+	#display_facet_range($f, $display, $name, $start, $end, $gap, $before, $after)
+#end
\ No newline at end of file

Modified: lucene/dev/trunk/solr/example/solr/conf/velocity/main.css
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/conf/velocity/main.css?rev=1095950&r1=1095949&r2=1095950&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/conf/velocity/main.css (original)
+++ lucene/dev/trunk/solr/example/solr/conf/velocity/main.css Fri Apr 22 15:39:07 2011
@@ -18,6 +18,18 @@
   margin-left: 20px;
 }
 
+.parsed_query_header {
+  font-family: Helvetica, Arial, sans-serif;
+  font-size: 10pt;
+  font-weight: bold;
+}
+
+.parsed_query {
+  font-family: Courier, Courier New, monospaced;
+  font-size: 10pt;
+  font-weight: normal;
+}
+
 body {
   font-family: Helvetica, Arial, sans-serif;
   font-size: 10pt;

Modified: lucene/dev/trunk/solr/example/solr/conf/velocity/query.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/conf/velocity/query.vm?rev=1095950&r1=1095949&r2=1095950&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/conf/velocity/query.vm (original)
+++ lucene/dev/trunk/solr/example/solr/conf/velocity/query.vm Fri Apr 22 15:39:07 2011
@@ -27,14 +27,16 @@
         #end
       #end
     </div>
+    <div class="parsed_query_header">
      #if($request.params.get('debugQuery'))
-        <a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>toggle
parsed query</a>
-        <pre style="display:none">$response.response.debug.parsedquery</pre>
+        <a href="#" onclick='jQuery(this).siblings("div").toggle(); return false;'>toggle
parsed query</a>
+        <div class="parsed_query" style="display:none">$response.response.debug.parsedquery</div>
       #end
       #set($queryOpts = $request.params.get("queryOpts"))
       #if($queryOpts && $queryOpts != "")
         <input type="hidden" name="queryOpts" value="$queryOpts"/>
       #end
+    </div>
   </form>
 
 </div>



Mime
View raw message