OR Queries by Combining Postings
An OR query can match documents containing either term. A document matching both still represents one result under the usual membership model.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace overlap
Lists 1, 5 and 5, 7 combine to 1, 5, 7 as a set. Document 5 can score differently because it matches twice, even though it only appears once. Set union determines the membership.
Keep result count and rank distinct
Returning the combined IDs answers eligibility. Use a separate policy to order them. See AND by intersection for a stricter eligibility rule.[1]
Merge candidates without emitting one item twice
If term A appears in documents one and four, and term B in two and four, their disjunction yields one, two and four. Document four can carry evidence from both terms while remaining one candidate. See ordinary union.
Postings A: [1,4]
Postings B: [2,4]
Union: [1,2,4]
Track both contributions for document 4 if ranking uses them
Separate collection order from relevance order
Merging sorted IDs yields ID order. A relevance scorer can reorder candidates afterward. Test disjoint lists, identical lists and an empty list.