docs: def call_doc_similarity(self, keywords, rerank_by_doc, start_date, end_date):
          """
          :param keywords: a string, a query, A dark knight
          :return: similar docs as returned by the vector similarity service
          """
          payload = {'query': keywords, 'k': self.constraint_remap_config['k'], 'rerank_by_doc': rerank_by_doc}
          if start_date is not None:
              payload['start_date'] = start_date
          if end_date is not None:
              payload['end_date'] = end_date
  
          """
          if rerank_by_doc is true then the results are returned as:
          [ {
              'doc_id': str(doc_id),
              'id_score_tups': [(str(faiss_id), diff_score <float32>) ],
              'score': doc_relevance <float32>
            } 
          ]
          
          otherwise the results are:
          [ {
              'score': diff_score <float32>, 
              'sentence_id': str(<int64>)
            } 
          ]
          """
          similar_docs = list()
          try:
              response = requests.get(self.constraint_remap_config['similarity_url'], params=payload)
              if response.status_code == 200:
                  similar_docs.extend(response.json())
          except Exception as e:
              print('Error: {}, while calling document similarity for query: {}'.format(e, keywords))
  
          if rerank_by_doc:
              for similar_doc in similar_docs:
                  similar_doc['sentence_id'] = [divmod(int(x[0]), 10000)[1] for x in similar_doc['id_score_tups']]
  
          else:
              for similar_doc in similar_docs:
                  doc_id, real_sentence_id = divmod(int(similar_doc['sentence_id']), 10000)
                  similar_doc['sentence_id'] = real_sentence_id
                  similar_doc['doc_id'] = str(doc_id)
          return similar_docs