liberation / django-elasticsearch

Simple wrapper around elasticsearch-py to index/search a django Model.
MIT License
212 stars 73 forks source link

Add operator __in to es.filter() for search in list. #53

Open onegreyonewhite opened 8 years ago

onegreyonewhite commented 8 years ago

This can fix #50 and good update for PR #51

lauxley commented 8 years ago

Yes i think it would be a good idea but does it still work with strings ? .filter(X__contains='test') used to return documents with not analyzed fields like 'foo test bar'. If not we might need another lookup, because it wouldn't be backward compatible and i don't see a reason to break this.

onegreyonewhite commented 8 years ago

@lauxley , I do not quite understand you. In #50, I raised the question of how to work with lists. I think that it is necessary to share the search for relevant lists and string. This pull request decide whether to #50. In order to carry out a filtering of the list of line, I'll think separately. And I use __in, for backward.

lauxley commented 8 years ago

Adding the __in lookup seems like a good idea, i didn't say otherwise so why do you say you don't understand me ? I can't merge the pull request just yet though, i want to check how it behaves with different types and re-check what problem it solves. And a test would be nice :)

onegreyonewhite commented 8 years ago

@lauxley, my English is not so good as I want it be. That's why I really can't understand the meaning of some phrases. I understand the words separetly, but the whole phrase sometimes seems difficult to get for me. But I have my wife, who helps me sometimes in English:)