Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnIndex: surprising behaviour if more than a single attribute is indexed #64

Open
d-maurer opened this issue Mar 27, 2019 · 2 comments
Open

Comments

@d-maurer
Copy link
Contributor

UnIndex suggests that it can index a document under several attributes (--> indexed_attrs).
However, it does not document what this means.

The current implementation effectively uses at most one attribute for any given object -- the last one in indexed_attrs for which the object has a value.

I do not think that this behaviour is intensional:

  • index_object iterates of indexed_attrs and updates _index and _unindex for each attribute for which the object has a value - with later attributes undoing the update of former ones; one could get the same effect without successive updates
  • it would be more natural that the first attribute with a value succeeds (rather than the last one).

I suggest to clearly document what indexing under several attributes should mean and ensure that the implementation follows (naturally) the intension.

@andbag
Copy link
Member

andbag commented Mar 28, 2019

I agree with you. I had already wondered about this behavior. If it should be changed, also the CompositeIndex must be adapted accordingly.

def _get_component_keywords(self, obj, component):

@d-maurer
Copy link
Contributor Author

d-maurer commented Mar 28, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants