Author: ssmiweve Date: 2008-09-18 14:34:43 +0200 (Thu, 18 Sep 2008) New Revision: 6827
Modified: trunk/ trunk/core-api/pom.xml trunk/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java trunk/generic.sesam/run-handler-config/ trunk/generic.sesam/run-handler-control/ trunk/generic.sesam/run-handler-control/src/main/java/no/sesat/search/run/handler/CopySearchRunHandler.java trunk/generic.sesam/run-handler-control/src/main/java/no/sesat/search/run/handler/FederatorRunHandler.java trunk/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/OverturePPCSearchCommand.java trunk/generic.sesam/sesam.com/war/src/main/conf/modes.xml trunk/pom.xml trunk/query-transform-control-spi/pom.xml trunk/query-transform-control-spi/src/main/java/no/sesat/search/query/transform/NewsCaseQueryTransformer.java trunk/result-spi/src/main/java/no/sesat/search/result/BasicResultList.java trunk/result-spi/src/main/java/no/sesat/search/result/StringChopper.java trunk/run-transform-control-spi/pom.xml trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchMode.java trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchModeFactory.java trunk/search-command-control-spi/pom.xml trunk/search-servlet-handler-spi/pom.xml trunk/war/pom.xml trunk/war/src/main/java/no/sesat/search/http/servlet/BoomerangServlet.java Log: Merged revisions 6760,6771,6778,6782,6784,6792-6793,6797-6798,6802-6804,6808-6809,6817-6819,6823 via svnmerge from http://sesat.no/svn/sesat-kernel/branches/2.17 ........ r6760 | ssmiweve | 2008-08-13 10:20:13 +0200 (Wed, 13 Aug 2008) | 1 line http://permalink.gmane.org/gmane.comp.java.sesat.kernel.devel/155 ........ r6771 | ssmiweve | 2008-08-19 17:21:16 +0200 (Tue, 19 Aug 2008) | 5 lines undo r6760 svn merge -r6760:6759 http://sesat.no/svn/sesat-kernel/branches/2.17 . Didn't work. ........ r6778 | ssmiweve | 2008-08-19 19:37:52 +0200 (Tue, 19 Aug 2008) | 3 lines remove restrictions on redeploying sesat on test environments. restriction remains for gamma and production ........ r6782 | sshafroi | 2008-08-20 12:49:01 +0200 (Wed, 20 Aug 2008) | 1 line Make it a warning, since this will take 5 sec if it fails, and you will not see anything with default logs. ........ r6784 | sshafroi | 2008-08-20 15:55:36 +0200 (Wed, 20 Aug 2008) | 4 lines Regexp only matched tags with longer names then 1 character. It will now match tags like <b>. See: Issue SKER4947: (StringChopper will not handle cdata) ........ r6792 | ssmiweve | 2008-08-26 23:55:54 +0200 (Tue, 26 Aug 2008) | 5 lines https://jira.sesam.no/jira/browse/SVERIGE-1349 live collection was passed through from one SearchDataObject to the next :-( a better copy constructors implemented in BasicResultList, and CopySearchRunHandler handles copying what the copy constructor cannot. ........ r6793 | sshafroi | 2008-08-29 10:03:46 +0200 (Fri, 29 Aug 2008) | 1 line Revert 6782, change warn back to debug. ........ r6797 | ssmiweve | 2008-08-30 09:35:35 +0200 (Sat, 30 Aug 2008) | 9 lines > java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 > at java.util.ArrayList.RangeCheck(ArrayList.java:547) > at java.util.ArrayList.get(ArrayList.java:322) > at java.util.Collections$UnmodifiableList.get(Collections.java:1154) > at no.sesat.search.run.handler.FederatorRunHandler.insertResult(FederatorRunHandler.java:90) > at no.sesat.search.run.handler.FederatorRunHandler.handleRunningQuery(FederatorRunHandler.java:63) ........ r6798 | ssmiweve | 2008-09-08 11:06:35 +0200 (Mon, 08 Sep 2008) | 1 line Issue SKER4938: (OverturePPCSearchCommand must support serverUrl parameter) ........ r6802 | ssmiweve | 2008-09-11 14:37:43 +0200 (Thu, 11 Sep 2008) | 2 lines cleanup our usage of jboss ejb3 client libraries. only those from http://sesat.no/maven2/org/jboss/ should be used. ........ r6803 | ssenrogn | 2008-09-15 08:47:07 +0200 (Mon, 15 Sep 2008) | 1 line Added Eclipse files to ignore list. ........ r6804 | ssenrogn | 2008-09-15 08:47:12 +0200 (Mon, 15 Sep 2008) | 1 line Added Eclipse files to ignore list. ........ r6808 | ssenrogn | 2008-09-16 09:22:50 +0200 (Tue, 16 Sep 2008) | 1 line SEARCH-4987 - rename of news case facade. ........ r6809 | ssenrogn | 2008-09-16 09:24:00 +0200 (Tue, 16 Sep 2008) | 1 line SEARCH-4987 - new version of newsadmin-services, cleanup of jboss deps. ........ r6817 | ssmiweve | 2008-09-16 23:05:32 +0200 (Tue, 16 Sep 2008) | 2 lines fix mistake made in r6802 ........ r6818 | ssmiweve | 2008-09-16 23:56:01 +0200 (Tue, 16 Sep 2008) | 2 lines switch sesam.com back to idp command ........ r6819 | ssmiweve | 2008-09-16 23:57:26 +0200 (Tue, 16 Sep 2008) | 2 lines Issue SKER5004: (Create option to disable the automatic rewrite of <multi-word query> to (<multi-word query>) when there are zero hits across all verticals) ........ r6823 | ssmiweve | 2008-09-18 11:43:03 +0200 (Thu, 18 Sep 2008) | 1 line SEARCH-5022- Correct sitemap erros etc. appearing in the Google webmaster tool ........ Property changes on: trunk ___________________________________________________________________ Name: svnmerge-integrated - /branches/2.10:1-4690,4692-4745 /branches/2.11:1-4933 /branches/2.12:1-5051,5053-5106 /branches/2.13:1-5378 /branches/2.14:1-5508 /branches/2.15:1-5995 /branches/2.16:1-6499 /branches/2.17:1-6713,6715-6752 /branches/2.6:1-3877 /branches/2.7:1-4160 /branches/2.8:1-4446 /branches/2.9:1-4626 /branches/MAP_SEARCHv2:1-4544 + /branches/2.10:1-4690,4692-4745 /branches/2.11:1-4933 /branches/2.12:1-5051,5053-5106 /branches/2.13:1-5378 /branches/2.14:1-5508 /branches/2.15:1-5995 /branches/2.16:1-6499 /branches/2.17:1-6713,6715-6826 /branches/2.6:1-3877 /branches/2.7:1-4160 /branches/2.8:1-4446 /branches/2.9:1-4626 /branches/MAP_SEARCHv2:1-4544 Modified: trunk/core-api/pom.xml =================================================================== --- trunk/core-api/pom.xml 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/core-api/pom.xml 2008-09-18 12:34:43 UTC (rev 6827) @@ -211,12 +211,19 @@ <type>jar</type> <version>4.0.5</version> </dependency> + + <!-- + Need to use the same version as on server cause of this bug: + https://jira.jboss.org/jira/browse/EJBTHREE-749 + --> <dependency> <groupId>org.jboss</groupId> - <artifactId>jboss-ejb3-client</artifactId> + <!-- artifactId>jboss-ejb3-client</artifactId --> + <artifactId>jboss-ejb3</artifactId> <type>jar</type> - <version>RC9</version> + <version>4.0.5</version> </dependency> + <dependency> <groupId>org.jboss</groupId> <artifactId>jboss-aspect-jdk50-client</artifactId> 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-09-18 11:02:13 UTC (rev 6826) +++ trunk/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -667,7 +667,8 @@ final String queryStr = datamodel.getQuery().getString(); if (!queryStr.startsWith("(") && !queryStr.endsWith(")") - && datamodel.getQuery().getQuery().getTermCount() > 1) { + && datamodel.getQuery().getQuery().getTermCount() > 1 + && context.getSearchMode().isAutoBroadening()) { // DataModel's ControlLevel will be RUNNING_QUERY_CONSTRUCTION // Increment it onwards to SEARCH_COMMAND_CONSTRUCTION. Property changes on: trunk/generic.sesam/run-handler-config ___________________________________________________________________ Name: svn:ignore - target + .project .classpath .settings .checkstyle target Property changes on: trunk/generic.sesam/run-handler-control ___________________________________________________________________ Name: svn:ignore - target + .project .classpath .settings .checkstyle target Modified: trunk/generic.sesam/run-handler-control/src/main/java/no/sesat/search/run/handler/CopySearchRunHandler.java =================================================================== --- trunk/generic.sesam/run-handler-control/src/main/java/no/sesat/search/run/handler/CopySearchRunHandler.java 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/generic.sesam/run-handler-control/src/main/java/no/sesat/search/run/handler/CopySearchRunHandler.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -26,6 +26,10 @@ import no.sesat.search.datamodel.DataModelFactory; import no.sesat.search.datamodel.generic.DataObject; import no.sesat.search.datamodel.search.SearchDataObject; +import no.sesat.search.result.BasicResultItem; +import no.sesat.search.result.BasicResultList; +import no.sesat.search.result.ResultItem; +import no.sesat.search.result.ResultList; import no.sesat.search.site.Site; import no.sesat.search.site.SiteKeyedFactoryInstantiationException; import org.apache.log4j.Logger; @@ -35,6 +39,12 @@ /** * Copy a SearchDataObject (with a new name). * + * The results is an instance of BasicResultList<BasicResultItem> with + * the list re-constructed with BasicResultList's copy constructor, and + * each item re-constructed with BasicResultItem's copy constructor. + * Be warned as particular functionality belonging to an implementation of ResultList or ResultItem + * other than BasicResultList and BasicResultItem may be lost. + * * @version $Id$ * */ @@ -75,17 +85,20 @@ final SearchDataObject from = datamodel.getSearch(config.getFrom()); if(null != from){ + final ResultList<ResultItem> resultList = new BasicResultList<ResultItem>(from.getResults()); + for(ResultItem item : from.getResults().getResults()){ + resultList.addResult(new BasicResultItem(item)); + } + final SearchDataObject searchDO = factory.instantiate( + SearchDataObject.class, + datamodel, + new DataObject.Property("configuration", from.getConfiguration()), + new DataObject.Property("query", from.getQuery()), + new DataObject.Property("results", resultList)); - final SearchDataObject searchDO = factory.instantiate( - SearchDataObject.class, - datamodel, - new DataObject.Property("configuration", from.getConfiguration()), - new DataObject.Property("query", from.getQuery()), - new DataObject.Property("results", from.getResults())); + datamodel.setSearch(config.getTo(), searchDO); - datamodel.setSearch(config.getTo(), searchDO); - }else{ LOG.error("from attribute in <copy-search from=\"someCommandName\" to=\"someCommandName\" " Modified: trunk/generic.sesam/run-handler-control/src/main/java/no/sesat/search/run/handler/FederatorRunHandler.java =================================================================== --- trunk/generic.sesam/run-handler-control/src/main/java/no/sesat/search/run/handler/FederatorRunHandler.java 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/generic.sesam/run-handler-control/src/main/java/no/sesat/search/run/handler/FederatorRunHandler.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -23,6 +23,7 @@ import no.sesat.search.datamodel.search.SearchDataObject; import no.sesat.search.result.ResultItem; import no.sesat.search.result.ResultList; +import org.apache.log4j.Logger; @@ -38,7 +39,7 @@ public FederatorRunHandler(final RunHandlerConfig rhc) { - config = (FederatorRunHandlerConfig) rhc; + config = (FederatorRunHandlerConfig) rhc; } @@ -71,6 +72,7 @@ } } + // does nothing if insertPosition is greater (or equal to) size of results private void insertResult( final ResultItem result, final ResultList<ResultItem> results, @@ -78,16 +80,23 @@ final List<ResultItem> original = results.getResults(); - // duplicate the last result - results.addResult(original.get(original.size()-1)); - // now shuffle back everything between insertPosition and the last result - for(int i = results.getResults().size()-2; i > insertPosition; --i){ - results.replaceResult(original.get(i), original.get(i-1)); + if( insertPosition < original.size() ){ + + // duplicate the last result + results.addResult(original.get(original.size()-1)); + + // now shuffle back everything between insertPosition and the last result + for(int i = results.getResults().size()-2; i > insertPosition; --i){ + // double check i exists in original list. + if( i < original.size() ){ + results.replaceResult(original.get(i), original.get(i-1)); + } + } + + // now add the new result in + results.replaceResult(original.get(insertPosition), result); } - // now add the new result in - results.replaceResult(original.get(insertPosition), result); - } } Modified: trunk/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/OverturePPCSearchCommand.java =================================================================== --- trunk/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/OverturePPCSearchCommand.java 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/OverturePPCSearchCommand.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -131,7 +131,7 @@ url.append("&type=" + ppcConfig.getType()); } - final String serveUrl = "http://" + datamodel.getSite().getSite().getName() + "/search/"; + final String serveUrl = "http://" + datamodel.getSite().getSite().getName() + "search/"; url.append("&Keywords="); url.append(URLEncoder.encode(getTransformedQuery().replace(' ', '+'), ppcConfig.getEncoding())); Modified: trunk/generic.sesam/sesam.com/war/src/main/conf/modes.xml =================================================================== --- trunk/generic.sesam/sesam.com/war/src/main/conf/modes.xml 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/generic.sesam/sesam.com/war/src/main/conf/modes.xml 2008-09-18 12:34:43 UTC (rev 6827) @@ -64,8 +64,10 @@ </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-idp-command"/> <!--yahoo-web-command id="globalSearch" inherit="default-yahoo-web-command"/--> + <!--solr-command id="globalSearch" inherit="default-command" result-fields="list_name AS title,list_entry AS body" server-url="solr.serverUrl"/--> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/pom.xml 2008-09-18 12:34:43 UTC (rev 6827) @@ -295,6 +295,7 @@ <sesam.site.generic>generic.alpha.test.sesam</sesam.site.generic> <sesam.site.default>${sesam.site.generic}</sesam.site.default> <serverDeployLocation>scpexe://sch-login01.osl.basefarm.net/www/schibstedsok/alpha.test.sesam.no</serverDeployLocation> + <tag.on.deploy>false</tag.on.deploy> </properties> <build> <plugins> @@ -313,6 +314,7 @@ <sesam.site.generic>generic.nuclei.test.sesam</sesam.site.generic> <sesam.site.default>${sesam.site.generic}</sesam.site.default> <serverDeployLocation>scpexe://sch-login01.osl.basefarm.net/www/schibstedsok/nuclei.test.sesam.no</serverDeployLocation> + <tag.on.deploy>false</tag.on.deploy> </properties> <build> <plugins> @@ -331,6 +333,7 @@ <sesam.site.generic>generic.beta.test.sesam</sesam.site.generic> <sesam.site.default>${sesam.site.generic}</sesam.site.default> <serverDeployLocation>scpexe://sch-login01.osl.basefarm.net/www/schibstedsok/beta.test.sesam.no</serverDeployLocation> + <tag.on.deploy>false</tag.on.deploy> </properties> <build> <plugins> @@ -348,6 +351,7 @@ <properties> <sesam.site.generic>generic.electron.test.sesam</sesam.site.generic> <sesam.site.default>${sesam.site.generic}</sesam.site.default> + <tag.on.deploy>false</tag.on.deploy> <serverDeployLocation>scpexe://sch-login01.osl.basefarm.net/www/schibstedsok/electron.test.sesam.no</serverDeployLocation> </properties> <build> @@ -562,6 +566,7 @@ <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1</version> + <scope>provided</scope> <!-- required to be put into container's lib directory --> </dependency> <dependency> <groupId>commons-beanutils</groupId> @@ -581,7 +586,8 @@ <dependency> <groupId>schibstedsok</groupId> <artifactId>newsadmin-services</artifactId> - <version>1.4</version> + <version>1.5</version> + <type>ejb-client</type> </dependency> <dependency> <groupId>org.testng</groupId> @@ -602,6 +608,27 @@ <artifactId>solrj</artifactId> <version>1.3-SNAPSHOT</version> </dependency> + <!-- old duplicate jboss ejb3 client libraries that get sucked in transitively --> + <dependency> + <groupId>jboss-client</groupId> + <artifactId>jboss-ejb3</artifactId> + <version>4.0.5</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>jboss-client</groupId> + <artifactId>jboss-ejb3x</artifactId> + <version>4.0.5</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>jboss-client</groupId> + <artifactId>jboss-annotations-ejb3</artifactId> + <version>4.0.5</version> + <scope>provided</scope> + </dependency> + </dependencies> </dependencyManagement> <dependencies> Modified: trunk/query-transform-control-spi/pom.xml =================================================================== --- trunk/query-transform-control-spi/pom.xml 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/query-transform-control-spi/pom.xml 2008-09-18 12:34:43 UTC (rev 6827) @@ -59,10 +59,10 @@ <scope>test</scope> <classifier>jdk15</classifier> </dependency> - <dependency> <groupId>schibstedsok</groupId> <artifactId>newsadmin-services</artifactId> + <type>ejb-client</type> </dependency> <!-- Testing --> Modified: trunk/query-transform-control-spi/src/main/java/no/sesat/search/query/transform/NewsCaseQueryTransformer.java =================================================================== --- trunk/query-transform-control-spi/src/main/java/no/sesat/search/query/transform/NewsCaseQueryTransformer.java 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/query-transform-control-spi/src/main/java/no/sesat/search/query/transform/NewsCaseQueryTransformer.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -1,4 +1,4 @@ -/* Copyright (2007) Schibsted Søk AS +/* Copyright (2007-2008) Schibsted Søk AS * This file is part of SESAT. * * SESAT is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ */ package no.sesat.search.query.transform; -import no.schibstedsok.newsadmin.service.NewsCaseFacadeInterface; +import no.schibstedsok.newsadmin.service.NewsCaseFacade; import no.sesat.search.query.Clause; import org.apache.log4j.Logger; @@ -138,12 +138,12 @@ /** * @return */ - public NewsCaseFacadeInterface lookupDataService() { + public NewsCaseFacade lookupDataService() { InitialContext ic = null; try { String serviceJndi = properties.getProperty(NEWSADMIN_JNDINAME); ic = new InitialContext(properties); - return (NewsCaseFacadeInterface) ic.lookup(serviceJndi); + return (NewsCaseFacade) ic.lookup(serviceJndi); } catch (NamingException e) { LOG.error("Could not lookup remote EJB.", e); } finally { @@ -166,7 +166,7 @@ public String getQuery(String newsCaseName, String queryType, int aggrId) { try { LOG.debug("Looking up query for: " + newsCaseName); - final NewsCaseFacadeInterface newsCaseFacade = lookupDataService(); + final NewsCaseFacade newsCaseFacade = lookupDataService(); if (newsCaseFacade != null) { String newsQuery = newsCaseFacade.searchForQuery(newsCaseName, queryType, aggrId); if (newsQuery != null) { Modified: trunk/result-spi/src/main/java/no/sesat/search/result/BasicResultList.java =================================================================== --- trunk/result-spi/src/main/java/no/sesat/search/result/BasicResultList.java 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/result-spi/src/main/java/no/sesat/search/result/BasicResultList.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -33,7 +33,7 @@ * Is not multi-thread safe. * All fields (of all types) handled by superclass BasicSearchResultItem. * - * @param T the type of ResultItem the ResultList contains. + * @param <T> the type of ResultItem the ResultList contains. * * @version <tt>$Id$</tt> */ @@ -65,23 +65,38 @@ /** Copy constructor. * Does not copy results, spellingSuggestions, querySuggestions, or relevantQueries. * - * ** @param copy + * @param copy */ public BasicResultList(final ResultItem copy){ super(copy); } - /** [EMAIL PROTECTED] **/ + /** Copy constructor. + * Does not copy results. + * + * @param copy + */ + public BasicResultList(final ResultList<ResultItem> copy){ + super(copy); + + + hitCount = copy.getHitCount(); + for(WeightedSuggestion ws : copy.getSpellingSuggestions()){ + // careful here. we're calling a possibly overridden method. + addSpellingSuggestion(ws); + } + querySuggestions.addAll(copy.getQuerySuggestions()); + relevantQueries.addAll(copy.getRelevantQueries()); + } + public void setHitCount(final int docCount) { this.hitCount = docCount; } - /** [EMAIL PROTECTED] **/ public int getHitCount() { return hitCount; } - /** [EMAIL PROTECTED] **/ public void addResult(final T item) { results.add(item); } @@ -110,7 +125,6 @@ Collections.sort(results, comparator); } - /** [EMAIL PROTECTED] **/ public void addSpellingSuggestion(final WeightedSuggestion suggestion) { if (spellingSuggestions.containsKey(suggestion.getOriginal())) { Modified: trunk/result-spi/src/main/java/no/sesat/search/result/StringChopper.java =================================================================== --- trunk/result-spi/src/main/java/no/sesat/search/result/StringChopper.java 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/result-spi/src/main/java/no/sesat/search/result/StringChopper.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -1,4 +1,4 @@ -/* Copyright (2005-2007) Schibsted Søk AS +/* Copyright (2005-2008) Schibsted Søk AS * This file is part of SESAT. * You can use, redistribute, and/or modify it, under the terms of the SESAT License. * You should have received a copy of the SESAT License along with this program. @@ -43,7 +43,7 @@ private static final String DEBUG_CHOPSUEY = "Chopped it up to "; - private static final Pattern openTag = Pattern.compile("<[^<]+>"); + private static final Pattern openTag = Pattern.compile("<[^?!][^<]*>"); private static final Pattern closeTag = Pattern.compile("</[^<]+>"); private static final Pattern singleTag = Pattern.compile("<[^<]+/>"); Modified: trunk/run-transform-control-spi/pom.xml =================================================================== --- trunk/run-transform-control-spi/pom.xml 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/run-transform-control-spi/pom.xml 2008-09-18 12:34:43 UTC (rev 6827) @@ -64,10 +64,12 @@ <scope>test</scope> <classifier>jdk15</classifier> </dependency> - <dependency> - <groupId>schibstedsok</groupId> - <artifactId>newsadmin-services</artifactId> - </dependency> + <dependency> + <groupId>schibstedsok</groupId> + <artifactId>newsadmin-services</artifactId> + <type>ejb-client</type> + </dependency> + <!-- Testing --> <dependency> <groupId>sesat</groupId> Modified: trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchMode.java =================================================================== --- trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchMode.java 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchMode.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -78,6 +78,7 @@ private Collection<SearchConfiguration> searchConfigurations; private SearchMode parentSearchMode; private boolean queryAnalysisEnabled = false; + private boolean autoBroadening = true; private String parentMode; private String id; private List<RunHandlerConfig> runHandlers; @@ -104,6 +105,7 @@ parentMode = inherit.parentMode; queryAnalysisEnabled = inherit.queryAnalysisEnabled; searchCommandExecutor = inherit.searchCommandExecutor; + autoBroadening = inherit.autoBroadening; } } @@ -163,6 +165,26 @@ } /** + * Get the autoBroadening. + * Automatic broadening results in any query returning zero hits across all commands will be wrapped in + * parenthesis () and re-executed. This changes any DefaultOperatorClauses to OrClauses. + * + * @return the autoBroadening. + */ + public boolean isAutoBroadening() { + return autoBroadening; + } + + /** + * Set the autoBroadening. + * + * @param autoBroadening The autoBroadening to set. + */ + public void setAutoBroadening(boolean autoBroadening) { + this.autoBroadening = autoBroadening; + } + + /** * Get the queryAnalysisEnabled. * * @return the queryAnalysisEnabled. Modified: trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchModeFactory.java =================================================================== --- trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchModeFactory.java 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchModeFactory.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -249,6 +249,7 @@ inherit != null ? inherit.getExecutor() : SearchMode.SearchCommandExecutorConfig.SEQUENTIAL)); fillBeanProperty(mode, inherit, "analysis", ParseType.Boolean, modeE, "false"); + fillBeanProperty(mode, inherit, "autoBroadening", ParseType.Boolean, modeE, "true"); mode.setRunTransformers(getRunTransformers(modeE, inherit)); mode.setRunHandlers(getRunHandlers(modeE, inherit)); Modified: trunk/search-command-control-spi/pom.xml =================================================================== --- trunk/search-command-control-spi/pom.xml 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/search-command-control-spi/pom.xml 2008-09-18 12:34:43 UTC (rev 6827) @@ -74,10 +74,10 @@ <scope>test</scope> <classifier>jdk15</classifier> </dependency> - <dependency> <groupId>schibstedsok</groupId> <artifactId>newsadmin-services</artifactId> + <type>ejb-client</type> </dependency> <!-- Testing --> Modified: trunk/search-servlet-handler-spi/pom.xml =================================================================== --- trunk/search-servlet-handler-spi/pom.xml 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/search-servlet-handler-spi/pom.xml 2008-09-18 12:34:43 UTC (rev 6827) @@ -59,10 +59,10 @@ <scope>test</scope> <classifier>jdk15</classifier> </dependency> - <dependency> <groupId>schibstedsok</groupId> <artifactId>newsadmin-services</artifactId> + <type>ejb-client</type> </dependency> <!-- Testing --> Modified: trunk/war/pom.xml =================================================================== --- trunk/war/pom.xml 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/war/pom.xml 2008-09-18 12:34:43 UTC (rev 6827) @@ -196,6 +196,7 @@ <groupId>axis</groupId> <artifactId>axis-saaj</artifactId> </dependency> + <dependency> <groupId>org.jboss</groupId> <artifactId>jbossall-client</artifactId> @@ -203,11 +204,16 @@ <version>4.0.5</version> </dependency> + <!-- + Need to use the same version as on server cause of this bug: + https://jira.jboss.org/jira/browse/EJBTHREE-749 + --> <dependency> <groupId>org.jboss</groupId> - <artifactId>jboss-ejb3-client</artifactId> + <!-- artifactId>jboss-ejb3-client</artifactId --> + <artifactId>jboss-ejb3</artifactId> <type>jar</type> - <version>RC9</version> + <version>4.0.5</version> </dependency> <dependency> Modified: trunk/war/src/main/java/no/sesat/search/http/servlet/BoomerangServlet.java =================================================================== --- trunk/war/src/main/java/no/sesat/search/http/servlet/BoomerangServlet.java 2008-09-18 11:02:13 UTC (rev 6826) +++ trunk/war/src/main/java/no/sesat/search/http/servlet/BoomerangServlet.java 2008-09-18 12:34:43 UTC (rev 6827) @@ -31,6 +31,7 @@ import java.util.List; import java.util.Map; import java.util.StringTokenizer; +import java.util.regex.Pattern; import no.sesat.search.datamodel.DataModel; import no.sesat.search.datamodel.generic.StringDataObject; import org.apache.commons.lang.StringEscapeUtils; @@ -57,6 +58,8 @@ private static final String CEREMONIAL = "/boomerang/"; + private static final Pattern ROBOTS = Pattern.compile("(Googlebot|Slurp|Crawler|Bot)", Pattern.CASE_INSENSITIVE); + @Override public void destroy() { } @@ -113,8 +116,9 @@ kangerooGrub(entrails); LOG.debug("Ceremonial boomerang to " + destination.toString()); - if(req.getHeader("User-agent").matches("(Googlebot|Slurp|Yahoo\\! Slurp)")){ - // crawlers like permanent redirects. and we're not interested in their clicks so ok to cache. + + if(ROBOTS.matcher(req.getHeader("User-agent")).find()){ + // robots like permanent redirects. and we're not interested in their clicks so ok to cache. res.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); res.setHeader("Location", destination.toString()); res.setHeader("Connection", "close"); _______________________________________________ Kernel-commits mailing list [email protected] http://sesat.no/mailman/listinfo/kernel-commits
