code: protected Query buildQuery(String spaceId, String key) {
          BooleanQuery.Builder builder = new BooleanQuery.Builder();
          if (!StringUtils.isBlank(spaceId)) {
              builder.add(new TermQuery(new Term(FIELD_SPACE_ID, spaceId.trim())), Occur.MUST);
          }
          if (!StringUtils.isBlank(key)) {
              builder.add(new TermQuery(new Term(FIELD_KEY, key.trim())), Occur.MUST);
          }
          return builder.build();
      }
docs: Build query to match entry's space-id and key.
  
  @param spaceId
  @param key
  @return