Reputation: 466
Now:
To reduce the quantity of possible candidates I was thinking about this:
for each post (
if number_of_search_words == number_of_post_words -> proceed with search logic
if number_of_search_words < number_of_post_words -> proceed with search logic
if number_of_search_words > number_of_post_words -> don't proceed with search logic
)
but that would also require an number containing the quantity of words of each post, which leads to more complexity.
Is there an elegant way of solving this?
Upvotes: 0
Views: 177
Reputation: 3891
You must to use bit containers, for example, BitMagic.
1
in the term-associated container, with postID as index.To search:
1
's for PostIDs, contains both search terms.Upvotes: 1