exclude NULL documents from indexing API request

Fixes an API error that occurred if all the posts were NULL.