You are here: Foswiki>Tasks Web>Item12586 (11 Feb 2014, MichaelDaum)Edit Attach

Item12586: SOLR: WebChanges-Pages fail on Subwebs

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: SolrPlugin
Branches: trunk
Reported By: OliverSchaub
Waiting For:
Last Change By: MichaelDaum
We Use SOLR for Search and for the Recent Changes. It all works fine, except for the Recent-Change for Subwebs. They are all just empty Pages, only showing the Web/Subweb as a title.

It looks like, the Search-String, which is sent to Solr is not correct (or solr is indexed wrong, however you look at it).

In Solr, the web is indexed as follows:
<str name="web">Web.Subweb</str>
but the Searchstring inside the json sent from the WebChanges-Topic looks like this:
web:Web/Subweb
The "slash" opposed to the "dot" is actually making the difference. If you fire a query on the Solr-Admin page using web:Web/Subweb, no results. If you are using web:Web.Subweb, it works.

-- OliverSchaub - 20 Sep 2013

Here's a hotfix:

--- data/System/WebChangesViewTemplate.txt      (revision 16877)
+++ data/System/WebChangesViewTemplate.txt      (working copy)
@@ -1,4 +1,4 @@
-%META:TOPICINFO{author="BaseUserMapping_999" comment="autosave" date="1356278806" format="1.1" version="1"}%
+%META:TOPICINFO{author="ProjectContributor" comment="autosave" date="1356278806" format="1.1" version="1"}%
 %{<verbatim class="tml">}%
 %TMPL:INCLUDE{"SolrSearchBase"}%
 %{</verbatim>}%
@@ -6,7 +6,7 @@
 %{<verbatim class="tml">}%
 %TMPL:DEF{"solr::searchform"}%%TMPL:END%
 %TMPL:DEF{"solr::resultsperpage"}%%TMPL:END%
-%TMPL:DEF{"solr::defaultweb"}%%BASEWEB%%TMPL:END%
+%TMPL:DEF{"solr::defaultweb"}%%FORMATLIST{"%BASEWEB%" split="/" separator="."}%%TMPL:END%
 %TMPL:DEF{"solr::defaultrows"}%20%TMPL:END%
 %TMPL:DEF{"solr::defaultquerytype"}%standard%TMPL:END%
 %TMPL:DEF{"solr::defaultsort"}%date desc%TMPL:END%
@@ -17,13 +17,9 @@
 %TMPL:DEF{"solr::title"}%<h1>
 %IF{"$web = 'all' or '%TMPL:P{"solr::defaultweb"}%' = 'all'" 
   then="%MAKETEXT{"Recent changes"}%"
-  else="%MAKETEXT{"Recent changes in [_1]" args="%TMPL:P{"baseweb"}%"}%"
+  else="%MAKETEXT{"Recent changes in [_1]" args="%TMPL:P{"solr::defaultweb"}%"}%"
 }%
 </h1>
 <input type="hidden" id='solrSorting' data-default-sort="%TMPL:P{"solr::defaultsort"}%" />
 %TMPL:END%
 %{</verbatim>}%
-
-%{<verbatim class="tml">}%
-%TMPL:DEF{"baseweb"}%%<nop>URLPARAM{"web" default="%TMPL:P{"solr::defaultweb"}%"}%%TMPL:END%
-%{</verbatim>}%

-- MichaelDaum - 20 Sep 2013

Thanks, the fix works fine.

-- OliverSchaub - 24 Sep 2013
 
Topic revision: r5 - 11 Feb 2014, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy