Term query by id or get api?

If I want to retrieve documents by id, which one is preferred?

  1. term query by id
  2. get api

Provided that performance is the first priority and I do not need to
retrieve by "real time", i.e. the freshness of the documents retrieved
can be the same as normal search.

Get api seems to be more preferred as it can be specified as "local",
but is the term query by id faster if the documents somehow is
"cached" internally?

Thanks,
Wing

On Tue, 2012-06-26 at 00:18 +0800, Yiu Wing TSANG wrote:

If I want to retrieve documents by id, which one is preferred?

  1. term query by id
  2. get api

Provided that performance is the first priority and I do not need to
retrieve by "real time", i.e. the freshness of the documents retrieved
can be the same as normal search.

Get api seems to be more preferred as it can be specified as "local",
but is the term query by id faster if the documents somehow is
"cached" internally?

The GET api will definitely be faster than the term query

clint