Author: ssenrogn Date: 2008-05-22 09:07:06 +0200 (Thu, 22 May 2008) New Revision: 6631
Modified: branches/2.17/generic.sesam/search-command-control/fast/src/main/java/no/sesat/search/mode/command/NewsClusteringESPFastCommand.java Log: RESOLVED - SEARCH-4733: NewsClusteringESPFastCommand: Could not convert result java.lang.NullPointerException. Added extra null-pointer-check. https://jira.sesam.no/jira/browse/SEARCH-4733 Modified: branches/2.17/generic.sesam/search-command-control/fast/src/main/java/no/sesat/search/mode/command/NewsClusteringESPFastCommand.java =================================================================== --- branches/2.17/generic.sesam/search-command-control/fast/src/main/java/no/sesat/search/mode/command/NewsClusteringESPFastCommand.java 2008-05-19 14:50:34 UTC (rev 6630) +++ branches/2.17/generic.sesam/search-command-control/fast/src/main/java/no/sesat/search/mode/command/NewsClusteringESPFastCommand.java 2008-05-22 07:07:06 UTC (rev 6631) @@ -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 @@ -79,13 +79,15 @@ */ @Override protected FastSearchResult<ResultItem> createSearchResult(final IQueryResult result) throws IOException { - try { final ClusteringEspFastCommandConfig config = getSearchConfiguration(); - final StringDataObject clusterId = datamodel.getParameters().getValue(config.getClusterIdParameter()); + final StringDataObject clusterId = datamodel.getParameters() != null + ? datamodel.getParameters().getValue(config.getClusterIdParameter()) : null; + if (config.isClusteringDisabled()) { - FastSearchResult<ResultItem> searchResult = super.createSearchResult(result); - int offset = getOffset(); + final FastSearchResult<ResultItem> searchResult = super.createSearchResult(result); + final int offset = getOffset(); + if (offset + config.getResultsToReturn() < result.getDocCount()) { addNextOffsetField(offset + config.getResultsToReturn(), searchResult); } @@ -102,6 +104,7 @@ } catch (RuntimeException e) { LOG.error(ERR_CONVERT, e); } + // Falling back to super implementation, because this one does not work. return super.createSearchResult(result); } _______________________________________________ Kernel-commits mailing list [email protected] http://sesat.no/mailman/listinfo/kernel-commits
