Author: ssmiweve
Date: 2008-03-28 09:15:37 +0100 (Fri, 28 Mar 2008)
New Revision: 6283

Added:
   
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/YahooWebCommandConfig.java
   
trunk/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooWebSearchCommand.java
Modified:
   trunk/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java
   trunk/generic.sesam/sesam.com/war/src/main/conf/configuration.properties
   trunk/generic.sesam/sesam.com/war/src/main/conf/messages_en.properties
   trunk/generic.sesam/sesam.com/war/src/main/conf/modes.xml
   trunk/generic.sesam/sesam.com/war/src/main/css/tab/default-sesam-com.css
   
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/classes/fragments/layout/sesam.com/footer.jsp
   
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/classes/fragments/layout/sesam.com/globalSearch.jsp
Log:
SEARCH-4302 - Building Sesam.com tutorial


Modified: trunk/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java
===================================================================
--- trunk/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java      
2008-03-27 13:44:26 UTC (rev 6282)
+++ trunk/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java      
2008-03-28 08:15:37 UTC (rev 6283)
@@ -143,8 +143,6 @@
         super(cxt);
         this.datamodel = cxt.getDataModel();
 
-        assert null == datamodel.getQuery();
-
         LOG.trace("RunningQuery(cxt," + query + ')');
 
         final String queryStr = trimDuplicateSpaces(query);

Added: 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/YahooWebCommandConfig.java
===================================================================
--- 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/YahooWebCommandConfig.java
                              (rev 0)
+++ 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/YahooWebCommandConfig.java
      2008-03-28 08:15:37 UTC (rev 6283)
@@ -0,0 +1,200 @@
+/* Copyright (2006-2007) Schibsted Søk AS
+ * This file is part of SESAT.
+ *
+ *   SESAT is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU Affero General Public License as published 
by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   SESAT is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU Affero General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Affero General Public License
+ *   along with SESAT.  If not, see <http://www.gnu.org/licenses/>.
+
+ */
+package no.sesat.search.mode.config;
+
+import no.sesat.search.mode.SearchModeFactory.Context;
+import no.sesat.search.mode.config.CommandConfig.Controller;
+import no.sesat.search.site.config.AbstractDocumentFactory;
+import no.sesat.search.site.config.AbstractDocumentFactory.ParseType;
+import org.w3c.dom.Element;
+
+/** Configuration for searches against Yahoo's Contextual Web Service.
+ * see http://developer.yahoo.com/search/web/V1/contextSearch.html
+ * @author mick
+ * @version <tt>$Id$</tt>
+ */
[EMAIL PROTECTED]("YahooWebSearchCommand")
+public class YahooWebCommandConfig extends AbstractYahooSearchConfiguration {
+
+    /**
+     * Holds value of property similar.
+     */
+    private boolean similar = false;
+
+    /**
+     * Getter for property similar.
+     * @return Value of property similar.
+     */
+    public boolean getSimilar() {
+        return this.similar;
+    }
+
+    /**
+     * Setter for property uniqusimilare.
+     * @param similar New value of property similar.
+     */
+    public void setSimilar(final boolean similar) {
+        this.similar = similar;
+    }
+
+    /**
+     * Holds value of property region.
+     */
+    private String country;
+
+    /**
+     * Getter for property country.
+     * @return Value of property country.
+     */
+    public String getCountry() {
+        return this.country;
+    }
+
+    /**
+     * Setter for property country.
+     * Available values written in 
http://developer.yahoo.com/search/countries.html
+     * @param country New value of property country.
+     */
+    public void setCountry(final String country) {
+        this.country = country;
+    }
+
+    /**
+     * Getter for property appid. Delegates to getPartnerId().
+     * @return Value of property appid.
+     */
+    public String getAppid() {
+        return getPartnerId();
+    }
+
+    /**
+     * Setter for property appid. Delegates to setPartnerId(..).
+     * Apply for a application ID here 
http://developer.yahoo.com/faq/index.html#appid
+     * @param appid New value of property appid.
+     */
+    public void setAppid(final String appid) {
+        setPartnerId(appid);
+    }
+    
+    /**
+     * Holds value of property language.
+     */
+    private String language = "en";
+
+    /**
+     * Getter for property language.
+     * @return Value of property language.
+     */
+    public String getLanguage() {
+        return this.language;
+    }
+
+    /**
+     * Setter for property language.
+     * see supported languages http://developer.yahoo.com/search/languages.html
+     * @param language New value of property language.
+     */
+    public void setLanguage(final String language) {
+        this.language = language;
+    }
+
+    /**
+     * Holds value of property site.
+     */
+    private String site;
+
+    /**
+     * Getter for property site.
+     * @return Value of property site.
+     */
+    public String getSite() {
+        return this.site;
+    }
+
+    /**
+     * Setter for property site.
+     * @param site New value of property site.
+     */
+    public void setSite(final String site) {
+        this.site = site;
+    }
+
+    /**
+     * Holds value of property format.
+     */
+    private String format = "any";
+
+    /**
+     * Getter for property format.
+     * @return Value of property format.
+     */
+    public String getFormat() {
+        return this.format;
+    }
+
+    /**
+     * Setter for property format.
+     * @param format New value of property format.
+     */
+    public void setFormat(final String format) {
+        this.format = format;
+    }
+
+    /**
+     * Holds value of property adult.
+     */
+    private boolean adult = false;
+
+    /**
+     * Getter for property adult.
+     * @return Value of property adult.
+     */
+    public boolean getAdult() {
+        return this.adult;
+    }
+
+    /**
+     * Setter for property adult.
+     * @param adult New value of property adult.
+     */
+    public void setAdult(final boolean adult) {
+        this.adult = adult;
+    }
+    
+    @Override
+    public YahooWebCommandConfig readSearchConfiguration(
+            final Element element,
+            final SearchConfiguration inherit,
+            final Context context) {
+
+        super.readSearchConfiguration(element, inherit, context);
+
+        AbstractDocumentFactory.fillBeanProperty(this, inherit, "appid", 
ParseType.String, element, "YahooDemo");
+        AbstractDocumentFactory.fillBeanProperty(this, inherit, "format", 
ParseType.String, element, "any");
+        AbstractDocumentFactory.fillBeanProperty(this, inherit, "adult_ok", 
ParseType.Boolean, element, "false");
+        AbstractDocumentFactory.fillBeanProperty(this, inherit, "similar_ok", 
ParseType.Boolean, element, "false");
+        AbstractDocumentFactory.fillBeanProperty(this, inherit, "language", 
ParseType.String, element, "en");
+        AbstractDocumentFactory.fillBeanProperty(this, inherit, "country", 
ParseType.String, element, null);
+        AbstractDocumentFactory.fillBeanProperty(this, inherit, "site", 
ParseType.String, element, null);
+
+        return this;
+    }
+
+
+
+}


Property changes on: 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/YahooWebCommandConfig.java
___________________________________________________________________
Name: svn:keywords
   + Id

Added: 
trunk/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooWebSearchCommand.java
===================================================================
--- 
trunk/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooWebSearchCommand.java
                            (rev 0)
+++ 
trunk/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooWebSearchCommand.java
    2008-03-28 08:15:37 UTC (rev 6283)
@@ -0,0 +1,200 @@
+/*
+ * Copyright (2008) Schibsted Søk AS
+ * This file is part of SESAT.
+ *
+ *   SESAT is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU Affero General Public License as published 
by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   SESAT is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU Affero General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Affero General Public License
+ *   along with SESAT.  If not, see <http://www.gnu.org/licenses/>.
+
+ */
+package no.sesat.search.mode.command;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.SocketTimeoutException;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+import no.sesat.search.mode.config.YahooIdpCommandConfig;
+import no.sesat.search.mode.config.YahooWebCommandConfig;
+import no.sesat.search.query.AndClause;
+import no.sesat.search.query.AndNotClause;
+import no.sesat.search.query.Clause;
+import no.sesat.search.query.DefaultOperatorClause;
+import no.sesat.search.query.LeafClause;
+import no.sesat.search.query.NotClause;
+import no.sesat.search.query.OrClause;
+import no.sesat.search.query.PhraseClause;
+import no.sesat.search.result.BasicResultList;
+import no.sesat.search.result.BasicResultItem;
+import no.sesat.search.result.ResultItem;
+import no.sesat.search.result.ResultList;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * Search against Yahoo! Contextual Web Service.
+ * http://developer.yahoo.com/search/web/V1/contextSearch.html
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Mck</a>
+ * @version $Id$
+ */
+public class YahooWebSearchCommand extends AbstractYahooSearchCommand {
+
+    private static final Logger LOG = 
Logger.getLogger(YahooWebSearchCommand.class);
+    private static final String ERR_FAILED_CREATING_URL = "Failed to create 
command url";
+
+    private static final String COMMAND_URL_PATTERN =
+            "/WebSearchService/V1/webSearch?appid={0}&query={1}&context={2}&"
+            + "results={3}&start={4}&"
+            + "format={5}&{6}{7}language={8}&{9}{10}";
+
+    private static final String DATE_PATTERN = "yyyy/MM/dd";
+    private static final String TOTALHITS_ATTRIBUTE ="totalResultsAvailable";
+    private static final String RESULT_ELEMENT = "Result";
+
+    /**
+     * Create new command.
+     *
+     * @param cxt The context to execute in.
+     */
+    public YahooWebSearchCommand(final Context cxt) {
+        super(cxt);
+    }
+
+    public ResultList<? extends ResultItem> execute() {
+
+        try {
+
+            final ResultList<ResultItem> searchResult = new 
BasicResultList<ResultItem>();
+
+            if(getTransformedQuery().trim().length() > 0
+                    || getAdditionalFilter().trim().length() > 0
+                    || "*".equals(getQuery().getQueryString())){
+
+                final Document doc = getXmlResult();
+
+                if (doc != null) {
+                    final Element searchResponseE = doc.getDocumentElement();
+                    final String totalHitsStr = 
searchResponseE.getAttribute(TOTALHITS_ATTRIBUTE);
+
+                    int totalHits;
+                    try {
+                        totalHits = Integer.parseInt(totalHitsStr);
+                    }catch(NumberFormatException e) {
+                        totalHits = Integer.MAX_VALUE;
+                    }
+                    searchResult.setHitCount(totalHits);
+
+                    // build results
+                    final NodeList list = 
searchResponseE.getElementsByTagName(RESULT_ELEMENT);
+                    for (int i = 0; i < list.getLength(); ++i) {
+                        final Element listing = (Element) list.item(i);
+                        final BasicResultItem item = createItem(listing);
+                        searchResult.addResult(item);
+                    }
+                }
+            }
+            return searchResult;
+
+        } catch (SocketTimeoutException ste) {
+
+            LOG.error(getSearchConfiguration().getName() +  " --> " + 
ste.getMessage());
+            return new BasicResultList<ResultItem>();
+
+        } catch (IOException e) {
+            throw new SearchCommandException(e);
+
+        } catch (SAXException e) {
+            throw new SearchCommandException(e);
+        }
+    }
+
+    /** Returns the GET http request path and parameters 
+     * 
+     * @return path and parameters to use.
+     */
+    protected String createRequestURL() {
+
+        final YahooWebCommandConfig conf = getSearchConfiguration();
+
+        final String wrappedTransformedQuery =  getTransformedQuery() + ' ' + 
getAdditionalFilter();
+        final String site = null != conf.getSite() 
+                ? "site=" + conf.getSite() 
+                : null != 
context.getDataModel().getParameters().getValue("site")
+                ? "site=" + 
context.getDataModel().getParameters().getValue("site").getUtf8UrlEncoded()
+                : "";
+
+        try {
+            return MessageFormat.format(
+                    COMMAND_URL_PATTERN,
+                    conf.getAppid(),
+                    URLEncoder.encode(wrappedTransformedQuery, "UTF-8"),
+                    URLEncoder.encode(wrappedTransformedQuery, "UTF-8"),
+                    conf.getResultsToReturn(),
+                    getOffset(),
+                    conf.getFormat(),
+                    conf.getAdult() ? "adult_ok=1&" : "",
+                    conf.getSimilar() ? "similar_ok=1&" : "",
+                    conf.getLanguage(),
+                    null != conf.getCountry() ? "country=" + conf.getCountry() 
+ "&" : "",
+                    site);
+            
+        } catch (UnsupportedEncodingException ex) {
+            throw new SearchCommandException(ERR_FAILED_CREATING_URL, ex);
+        }
+    }
+
+    /** Assured that associated SearchConfiguration is always of this type. **/
+    @Override
+    public YahooWebCommandConfig getSearchConfiguration() {
+        return (YahooWebCommandConfig)super.getSearchConfiguration();
+    }
+
+    /** 
+     * 
+     * @param result
+     * @return
+     */
+    protected BasicResultItem createItem(final Element result) {
+
+        final BasicResultItem item = new BasicResultItem();
+
+        for (final Map.Entry<String,String> entry : 
getSearchConfiguration().getResultFields().entrySet()){
+
+            final Element fieldE = (Element) 
result.getElementsByTagName(entry.getKey()).item(0);
+            if(null != fieldE && fieldE.getChildNodes().getLength() >0){
+                item.addField(entry.getValue(), 
fieldE.getFirstChild().getNodeValue());
+            }
+        }
+
+        return item;
+    }
+
+    @Override
+    public String getTransformedQuery() {
+        final String tq = super.getTransformedQuery();
+        if(tq == null) {
+            LOG.debug("transformedQuery is null, using \"\"");
+            return "";
+        }
+        return tq;
+    }
+
+}


Property changes on: 
trunk/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooWebSearchCommand.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: 
trunk/generic.sesam/sesam.com/war/src/main/conf/configuration.properties
===================================================================
--- trunk/generic.sesam/sesam.com/war/src/main/conf/configuration.properties    
2008-03-27 13:44:26 UTC (rev 6282)
+++ trunk/generic.sesam/sesam.com/war/src/main/conf/configuration.properties    
2008-03-28 08:15:37 UTC (rev 6283)
@@ -3,3 +3,9 @@
 site.locale.default=en
 site.issitesearch=false
 site.defaultTab=g
+
+yahooWebHost=search.yahooapis.com
+yahooWebPort=80
+
+# disable fast token evaluation. HACK while we wait for SEARCH-3540 Anonymous 
TokenPredicates & Token Evaluator SPI.
+tokenevaluator.port=0
\ No newline at end of file

Modified: trunk/generic.sesam/sesam.com/war/src/main/conf/messages_en.properties
===================================================================
--- trunk/generic.sesam/sesam.com/war/src/main/conf/messages_en.properties      
2008-03-27 13:44:26 UTC (rev 6282)
+++ trunk/generic.sesam/sesam.com/war/src/main/conf/messages_en.properties      
2008-03-28 08:15:37 UTC (rev 6283)
@@ -11,7 +11,7 @@
 noHits=No results for {0}
 noHitsPossibleReasons=
 builtWithSesat=Built with <a href="http://sesat.no";>Sesat</a> using this <a 
href="http://sesat.no/tutorial-building-sesamcom.html";>tutorial</a>.
-resultsFromYahoo=Results from the Yahoo!
+resultsFromYahoo=Results from <a href="http://developer.yahoo.com/";>Yahoo!</a>
 prev=previous
 next=next
 

Modified: trunk/generic.sesam/sesam.com/war/src/main/conf/modes.xml
===================================================================
--- trunk/generic.sesam/sesam.com/war/src/main/conf/modes.xml   2008-03-27 
13:44:26 UTC (rev 6282)
+++ trunk/generic.sesam/sesam.com/war/src/main/conf/modes.xml   2008-03-28 
08:15:37 UTC (rev 6283)
@@ -28,7 +28,7 @@
             <!-- mode inheritence is a restricted one child to one parent 
relationship
                     so we inherit default-magic -->  
 
-        <yahoo-idp-command id="default-yahoo-i18n-command" 
inherit="default-yahoo-i18n-command"
+        <yahoo-idp-command id="default-yahoo-idp-command" 
inherit="default-yahoo-i18n-command"
                            database="www-no"
                            host="yahooIdpHost"
                            language=""
@@ -44,10 +44,26 @@
             </result-handlers>
         </yahoo-idp-command>
         
+
+        <yahoo-web-command id="default-yahoo-web-command"
+                           appid="YahooDemo"
+                           field-filters="site"
+                           host="yahooWebHost"
+                           language="en"
+                           port="yahooWebPort"
+                           result-fields="Title AS title,Summary AS body,Url 
AS url,ClickUrl AS clickurl"
+                           results-to-return="10">                             
               
+            <result-handlers>
+                <field-chooser target="title" fields="title,url"/>
+                <regexp field="url" target="site" regexp="http://([^/]*)/?"/>
+            </result-handlers>
+        </yahoo-web-command>        
+        
     </mode>
     
     <mode id="international" inherit="default-mode">
-        <yahoo-idp-command id="globalSearch" 
inherit="default-yahoo-i18n-command"/>
+        <!--yahoo-idp-command id="globalSearch" 
inherit="default-yahoo-i18n-command"/-->
+        <yahoo-web-command id="globalSearch" 
inherit="default-yahoo-web-command"/>
     </mode>
     
 </modes>

Modified: 
trunk/generic.sesam/sesam.com/war/src/main/css/tab/default-sesam-com.css
===================================================================
--- trunk/generic.sesam/sesam.com/war/src/main/css/tab/default-sesam-com.css    
2008-03-27 13:44:26 UTC (rev 6282)
+++ trunk/generic.sesam/sesam.com/war/src/main/css/tab/default-sesam-com.css    
2008-03-28 08:15:37 UTC (rev 6283)
@@ -33,6 +33,10 @@
     text-align: left;
 }
 
+#footer {
+    width: 100%;
+}
+
 /* =Header */
 
 #logo {
@@ -41,7 +45,6 @@
 /* =Search boxes */
 
 #sf {
-    /*min-width: 800px;*/
     background: url(/images/searchbar/bg.png) repeat-x;
     margin-left: 15px;
     padding-right: 15px;
@@ -49,7 +52,7 @@
 
 #inputBox {   
     float: left;
-    margin: 27px 0px 0px 20px;
+    margin: 0px 0px 0px 20px;
     border: 1px solid #bcc5cc;
     padding: 4px 2px 3px 2px;
     font-weight: bold;
@@ -58,7 +61,7 @@
 
 #inputButton {
     float: left;
-    margin: 27px 0px 0px 0px;
+    margin: 0px 0px 0px 0px;
     padding-right: 8px;
 }
 
@@ -166,8 +169,14 @@
 #footer_help {
     clear: both;
     padding: 20px 0px 20px 15px;
+    width: 100%;
 }
 
+#footer_help div {
+    float: left;
+    padding-right: 40px;
+}
+
 /* ------------------------------------------------------------------ */
 /* =NO HITS  */
 

Modified: 
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/classes/fragments/layout/sesam.com/footer.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/classes/fragments/layout/sesam.com/footer.jsp
     2008-03-27 13:44:26 UTC (rev 6282)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/classes/fragments/layout/sesam.com/footer.jsp
     2008-03-28 08:15:37 UTC (rev 6283)
@@ -24,9 +24,8 @@
     Version    : $Id$
 -->
 <div id="footer_help">
-    <jsp:text><![CDATA[<span>&copy;2008</span>&nbsp;&nbsp;]]></jsp:text>
-    <search:text key="builtWithSesat"/>
-    <jsp:text><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;]]></jsp:text>
-    <search:text key="resultsFromYahoo"/>
+    <jsp:text><![CDATA[<div id="copyright">&copy;2008</div>]]></jsp:text>
+    <div id="builtWithSesat"><search:text key="builtWithSesat"/></div>
+    <div id="resultsFromYahoo"><search:text key="resultsFromYahoo"/></div>
 </div>
 </jsp:root>
\ No newline at end of file

Modified: 
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/classes/fragments/layout/sesam.com/globalSearch.jsp
===================================================================
--- 
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/classes/fragments/layout/sesam.com/globalSearch.jsp
       2008-03-27 13:44:26 UTC (rev 6282)
+++ 
trunk/generic.sesam/sesam.com/war/src/main/webapp/WEB-INF/classes/fragments/layout/sesam.com/globalSearch.jsp
       2008-03-28 08:15:37 UTC (rev 6283)
@@ -34,11 +34,10 @@
                     <c:set var="msg_international_icon_alt"><search:text 
key="international_icon_alt"/></c:set>
                     <img src="/images/international_icon.png" width="16" 
height="16" alt="${msg_international_icon_alt}"/>
                     <span>
-                        <c:set var="hitcount"><search:hitcount 
hitcount="${$DataModel.searches[commandName].results.hitCount}"/></c:set>
                         <search:text key="international_search_results"
                             
arg0="${DataModel.navigation.navigations.offset.fields.currentPageFromCount}"
                             
arg1="${DataModel.navigation.navigations.offset.fields.currentPageToCount}"
-                            arg2="${hitcount}"
+                            
arg2="${DataModel.searches[commandName].results.hitCount}"
                             arg3="${DataModel.query.utf8UrlEncoded}"/>
                     </span>
                 </div>
@@ -48,7 +47,7 @@
                     <c:set var="pos" 
value="${DataModel.navigation.navigations.offset.fields.currentPageFromCount + 
i}"/>
 
                     <p id="p${i}">
-                        <img class="search_big_url_icon" 
src="http://${item.fields.site}/favicon.ico"/>
+                        <img class="search_big_url_icon" 
src="http://${item.fields.site}/favicon.ico"; width="16" height="16"/>
                         <jsp:text><![CDATA[&nbsp;]]></jsp:text>
                         <c:set var="item_href"><search:boomerang 
url="${item.fields.clickurl}" param="category:results;pos:${pos}"/></c:set>
                         <a href="${item_href}" 
class="search_big_url">${item.fields.title}</a>
@@ -65,9 +64,9 @@
                             ${item.fields.url}
 
                             <!-- More hits from -->
-                            <c:if test="${empty 
$DataModel.parameters.values.domain or 
$DataModel.parameters.values.domain.xmlEscaped ne $item.fields.site}">
+                            <c:if test="${empty 
$DataModel.parameters.values.moreHits}">
                               -
-                                <c:set var="moreHits_href"><search:boomerang 
url="/search/?c=${tab.key}&amp;q=${DataModel.searches[commandName].query.utf8UrlEncoded}&amp;domain=${item.fields.site}"
 param="category:results;pos:${pos}"/></c:set>
+                                <c:set var="moreHits_href"><search:boomerang 
url="/search/?c=${tab.key}&amp;q=${DataModel.searches[commandName].query.utf8UrlEncoded}+site%3A${item.fields.site}&amp;moreHits=true"
 param="category:results;pos:${pos}"/></c:set>
                                 <a href="${moreHits_href}" 
class="more_hits_link"><search:text key="moreHitsFrom"/></a>
                             </c:if>
 

_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to