hunt-framework / hunt

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

Do we need 'unionWithConv' within the Index interface? #65

Closed chrisreu closed 10 years ago

chrisreu commented 10 years ago

We are using this function only in the lowest index implementations, that interact directly with the StringMap. The function is only used internally in those instances. All instances above are throwing an error, because this function is not implementable there (no access to underlying structures).

  unionWithConv
    = error "InvertedIndex unionWithConv: cannot be used there because type variable v is fixed"

To me it looks like this function should not be in the general Index interface. Am i right or am i missing something here?

ulfsauer0815 commented 10 years ago

It was intended to be an efficient union for our index interface so that we can merge efficiently. The result was kind of messy because of our compression index implementation as far as I can remember. That led to it only being used in the insert function of the same index implementation. This would otherwise also be useful for something like snapshots, where we want to merge the indexes at some time in the future. Maybe we can get the types right or achieve the same thing with rewrite rules? Either way, it is probably better to remove it from the interface for now.