hunt-framework / hunt

A flexible, lightweight search platform
59 stars 10 forks source link

DocIdMap: Do we need a strict and a lazy one? #64

Closed chrisreu closed 10 years ago

chrisreu commented 10 years ago

In the index and document table we always need the docidmap to be strict. But in query execution we generally want everything to be lazy.

Right now the strict map is used for the queries as well. I think this would result in evaluation of the whole map, once one docID is required, despite how many documents are returned in the end. What do you think?

ulfsauer0815 commented 10 years ago

What are you suggesting? A BinTree.Lazy implementation?

I don't think the performance impact would be that high. I can picture it to be relevant in AND NOT queries where we might not have to look at some values. Otherwise the intermediate structure should have to be fully evaluated anyway to merge and rank the results. The strict DocIdMap only forces the evaluation of values to WHNF, the values themselves can still be lazy, e.g. a list. The keys are strict either way.

chrisreu commented 10 years ago

I wasn't sure about the actual impact within query execution. If it is indeed minimal i agree to ignore this case.