HomeSoftware Heritage

metadata-search: Skip query to swh-indexer when its results would be discarded

Description

metadata-search: Skip query to swh-indexer when its results would be discarded

The 'fields' query parameter is used by clients to indicate what fields the
API should return.

If 'metadata' is not in that field, then the 'metadata' object will be
discarded by apiresponse, so the call to
idx_storage.origin_intrinsic_metadata_get is useless.

I expect no client actually uses this field, so this could save
ressources.

Additionally, I want to deprecate the field, so this may make it easier
to figure if any client actually requests it by looking at server logs.