title: java.lang.IllegalArgumentException: fromIndex() > toIndex() on Custom Search
body: <p>I have modified liferay's default <code>Blog portlet via EXT</code> to meet up my requirement.</p>
  
  <p>In <code>control panel</code> when I click on <code>Blogs portlet</code> and try to search for a Blog with say "test" then I can see the list of Blogs with proper pagination.</p>
  
  <p>For example , for 44 entries of corresponding Blogs I can see 3 pages i.e 3 links:</p>
  
  <blockquote>
    <p>1 2 Next</p>
  </blockquote>
  
  <p>But when I follow same step for <code>my customized Blog portlet</code> then for same results I can see 4 links:</p>
  
  <blockquote>
    <p>1 2 3 Next</p>
  </blockquote>
  
  <p>Now when I click on 3, empty display appears with backend error saying :</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: fromIndex(60) > toIndex(44)</p>
  </blockquote>
  
  <p>This issue may be related to <a href="http://issues.liferay.com/browse/LPS-25143" rel="nofollow">Liferay Issue: 25143</a> and also they have marked it as closed but couldn't find what exact modification they have done.</p>
  
  <p>In search.jsp of liferay's default blog </p>
  
  <blockquote>
    <p>(html/portlet/blogs/search.jsp)</p>
  </blockquote>
  
  <p>and my custom blog </p>
  
  <blockquote>
    <p>(ext-web/docroot/html/portlet/mycustomblogs/search.jsp)</p>
  </blockquote>
  
  <p>, I put a log printing total no. of records:</p>
  
  <blockquote>
    <p>Hits results = indexer.search(searchContext);</p>
    
    <p>int total = results.getLength();</p>
    
    <p>_log.info("total: "+total);</p>
  </blockquote>
  
  <p>I observed different out put i.e count was different for both. I am wondering that it might be related to Indexer.</p>
  
  <p>I may need more configuration related between Indexer and my customblog. As of now I have following entry in my liferay-portlet-ext.xml related to search as same as Liferay's Blog.</p>
  
  <pre><code>&lt;indexer-class&gt;com.liferay.portlet.blogs.util.BlogsIndexer&lt;/indexer-class&gt;
  &lt;open-search-class&gt;com.liferay.portlet.blogs.util.BlogsOpenSearchImpl&lt;/open-search-class&gt;
  </code></pre>
  
  <p>Can anybody help me to find the exact cause, please. </p>
  
  <p>Thanks</p>