主权项 |
1. A method, comprising:
receiving, from a client, a search query including filter criteria, wherein the filter criteria specify a plurality of operands including a first operand associated with one or more filters, a second operand associated with one or more filters and a logical relationship between the plurality of operands; and in response to the search query:
identifying a plurality of index portions including a first set of one or more index portions matching the filter(s) of the first operand and a second set of one or more index portions matching the filter(s) of the second operand, wherein index entries in the first set of index portion(s) and the second set of index portion(s) are sorted in a same sort order in accordance with identifiers for the index entries;identifying one or more matching entities that match the search query, wherein the identifying includes:
identifying a plurality of candidate identifiers including a respective candidate identifier for each respective operand in the plurality of operands, including:
identifying, in the first set of index portion(s), a first set of one or more index entries having a first identifier with a value closest to a predefined end of a range of identifier values in the first set of index portion(s) and matching the filter(s) of the first operand, wherein the first identifier comprises the respective candidate identifier for the first operand;identifying, in the second set of index portion(s), a second set of one or more index entries having a second identifier with a value closest to the predefined end of the range of identifier values in the second set of index portion(s) and matching the filter(s) of the second operand, wherein the second identifier comprises the respective candidate identifier for the second operand;comparing the plurality of candidate identifiers to each other to identify a candidate identifier that is closest to the predefined end of the range of identifier values, and:
in accordance with a determination that the first identifier is the candidate identifier closest to the predefined end of the range of identifier values, marking an entity associated with the first identifier as matching the search query and identifying, in the first set of index portion(s), a third set of one or more index entries having a third identifier that is sequentially adjacent to the first identifier in the sort order and matching the filter(s) of the first operand; andin accordance with a determination that the second identifier is the candidate identifier closest to the predefined end of the range of identifier values, marking an entity associated with the second identifier as matching the search query and identifying, in the second set of index portion(s), a fourth set of one or more index entries having a fourth identifier that is sequentially adjacent to the second identifier in the sort order and matching the filter(s) of the second operand; and transmitting representations of one or more of the matching entities to the client. |