-
Notifications
You must be signed in to change notification settings - Fork 32
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
Why was the Haystack read Op split into get_entity and find_entity? #111
Comments
humm.... maybe @sjlongland can chime in, but I think it was a way to save resources. You can ask for a great number of entities and just find them, without reading their content. This way you only get a list. Once you have the list of result, you can choose to go further and get the entity(ies) you need. |
The def read(self, ids=None, filter_expr=None, limit=None, callback=None):
"""
Retrieve information on entities matching the given criteria.
Either ids or filter_expr may be given. ids may be given as a
list or as a single ID string/reference.
filter_expr is given as a string. pyhaystack.util.filterbuilder
may be useful for generating these programatically.
:param id: ID of a single entity to retrieve
:param ids: IDs of many entities to retrieve as a list
:param filter_expr: A filter expression that describes the entities
of interest.
:param limit: A limit on the number of entities to return.
""" So you absolutely can do a e.g. If your entity has a Furthermore, if CRUD is implemented for the specific Haystack server you're using, you can alter Basically, it's an ORM layer atop Haystack. You can use it or ignore it as your needs require. |
This is not an issue per se, but I am curious as to pyhaystack's design choices on this. Apologies if there was another place you would have preferred me to ask this question.
The "Operation basics" section of the pyhaystack documentation closely matches the Haystack docs for the
about
andnav
operations, which makes it easy to understand what pyhaystack is doing. But the functionality for theread
Op seems to have been split intoget_entity
andfind_entity
methods, that use the by id and by filter options for theread
Op, respectively. Bringing this up because this was initially very confusing to me.Is there a reason you chose not to implement
but instead
and
?
The text was updated successfully, but these errors were encountered: