When documents are added to Solr, they are not visible to new search requests until a "commit" operation has been executed. [1]
When you ask gsearch to run an "optimize" operation, it is a type of "hard commit" on Solr, and then the new items will be available to search requests.
There are numerous ways to address this, depending on your needs. You can either run a 'commit' or 'optimize' command manually after bulk ingests.
Or, you can add a "commitWithin" attribute to the <add> element of the Solr DocumentXML:
<add commitWithin="15000">
<doc>
...
</doc>
</add>
Or, you can update the solrconfig.xml file inside Solr. For that, you will want to configure an <autoCommit> or <autoSoftCommit> clause. For example (in Solr 4.2):
<autoCommit>
<maxTime>15000</maxTime>
<openSearcher>true</openSearcher>
</autoCommit>
(commits every 15 seconds)
Or:
<autoSoftCommit>
<maxTime>1000</maxTime>
</autoSoftCommit>
(commits every 1 second)
Aaron