Currently, the exists() method in FakeOpenSearch relies on getting a document type that is used alongside the index and document id when checking if a document exists. If a document type is not input, it defaults to None and will return false because it checks, for example, if the document type "_doc" == None.
The opensearchpy implementation does not need a document type input and only needs the index name and document id to check for the existence of the document. In openmock, the exists method should ignore whether the document type matches when the value is None.
File Changes
fake_opensearch.py
added a condition so that if the doc_type in exists() is None, then only the index name and document id are used to check if the document matches. This is to better align with the openearchpy implementation.
Change Overview
Currently, the exists() method in FakeOpenSearch relies on getting a document type that is used alongside the index and document id when checking if a document exists. If a document type is not input, it defaults to None and will return false because it checks, for example, if the document type "_doc" == None.
The opensearchpy implementation does not need a document type input and only needs the index name and document id to check for the existence of the document. In openmock, the exists method should ignore whether the document type matches when the value is None.
File Changes