can terms lookup mechanism query by other field but id?

前端 未结 2 642
难免孤独
难免孤独 2021-01-20 04:35

here is elasticsearch official website about terms: https://www.elastic.co/guide/en/elasticsearch/reference/2.1/query-dsl-terms-query.html

As we can see, if we want

2条回答
  •  天命终不由人
    2021-01-20 04:52

    I think you did not understand exactly how this works. Terms lookup query works by reading values from a field of a document with the given id. In this case, you are trying to match the value of field user in tweets index with values of field followers in document with id "2" present in users index and user type.

    If you want to read from any other field then simply mention that in "path".

    What you mainly need to understand is that the lookup values are all fetched from a field of a single document and not multiple documents.

提交回复
热议问题