fixed fetchEntitiesFromDB to return multiple es search result types;
saveRecord can skip records if filter condition is meet
bug fix
use options.base if defined when fetching entities from DB
added back lost code
total count fix;
Merge branch 'ckiss-master'

Conflicts:
	elasticsearch.js