First let me check my assumption is correct . As i understand ES calculates IDF across specific fields. So when I read things like "It is a ratio of all documents to documents containing the searched term." it really means "It is a ratio of all documents to documents containing the searched term in the specific field you are searching. So if I search a field "name", with a query "Robert", it's irrelevant if a document contains "Robert" in any other field. Correct?
Now, if there are two documents with a field "name", and one of them has "Robert" in it and the other doesn't, then IDF is log (2/1). However, what if the second document doesn't have a field name at all? Is it still counted? Is it log(1/1) in this case or still log(2/1)? Thanks