Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Drayton 29 posts 49 karma points
    Dec 09, 2011 @ 12:30
    Peter Drayton
    0

    Bug in FullTextSearch Project

    Hi,

     

    Not quite sure if this is the correct place to post this or not?

    Think I have discovered a bug in the FullTextSearch project.

    It works fine, but appears to be calculating the Number of Pages incorrectly?

    On the site I'm working on, I have set paging for 5 results per Page.
    If the number of results is a multiple of 5, it calculates Number of Pages incorrectly?

    e.g. 10 results, the XML returned by the DLL is 3
    <summary numResults="10" numPages="3" timeTaken="0.009" firstResult="1" lastResult="5" />

     

    To fix this I have modifed the xslt to get it work properly:

    OLD XSLT:
        <xsl:if test="number($searchResults/results/summary/@numPages) &gt; 1">
          <xsl:call-template name="pagination">
            <xsl:with-param name="numPages" select="$searchResults/results/summary/@numPages" />
            <xsl:with-param name="pageNumber" select="$pageNumber" />
          </xsl:call-template>
        </xsl:if>

    NEW XSLT:
        <xsl:if test="number($searchResults/results/summary/@numResults) &gt; 5">
          <xsl:call-template name="pagination">
            <xsl:with-param name="numPages" select="number($searchResults/results/summary/@numResults) div 5" />
            <xsl:with-param name="pageNumber" select="$pageNumber" />
          </xsl:call-template>
        </xsl:if>

     

     

Please Sign in or register to post replies

Write your reply to:

Draft