2 Replies Latest reply on Feb 16, 2012 3:02 PM by JimG

    API search will only return the first 200 results????

      It seems that I can only retrieve 200 results when using doOracleSimpleSearch api call.
          osr = oses.doOracleSimpleSearch(strSearch, 1, 1000, false, false, true);
          nCount = osr.docsReturned;
          nCount2 = osr.resultElements.Length;
          nCount3 = osr.estimatedHitCount;
      nCount and nCount2 are both 200.
      nCount3 is 1332

      Ok, no problem. Even though I asked for 1000 results, I figure it will only return 200 at a time, so I write a simple loop.
         while (nTotalResults < nCount3)
            osr = oses.doOracleSimpleSearch(strSearch, nTotalResults + 1, 200, false, false, true);
            nCount = osr.docsReturned;
            nTotalResults += nCount;
      After executing the search the first time, nTotalResults is set to 200, so I'm now requesting that the search starts at index 201 and to return the next block of 200.

      osr.docsReturned is now = 0

      stuck in infinite loop because it's not returning all my results.


      It seems this is not just an API issue. If I do the search through the web interface, and go to page 20 (it's displaying 10 results per page) I see results. But as soon as I go to page 21, the page is blank even though it says there are over 1000 results.

      Edited by: JimG on Feb 15, 2012 5:17 PM