Search code examples
djangoelasticsearchfull-text-searchdjango-haystack

Object could not be found in database for SearchResult django haystack


I am using haystack with elasticsearch. I have build index data using rebuild_index command. But when I tried to search for object, its giving me following error:

"Object could not be found in database for SearchResult ' (pk=u'118')>'."

I have double checked in database, no records were deleted. But I am still getting this error.

Can anyone please help with it?

Thanks.


Solution

  • Answering it to mark it resolved.

    It was database config issue. I am having different settings file for different environment, and was having mismatch for database config in both files.