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

Adding start/offset option for queries #421

Merged
merged 1 commit into from
May 20, 2014

Conversation

no-reply
Copy link
Contributor

Solr supports paginated results with the start option. This adds that
to the find/query methods.

end

def start_value=(value)
raise ImmutableRelation if @loaded
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend using loaded?' here instead of@loaded'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed.

It should be noted that @loaded is used throughout this module. These _value methods could probably stand to be refactored. A lot of repetition.

@jcoyne
Copy link
Member

jcoyne commented May 15, 2014

Can we call it offset so it matches ActiveRecord? See http://guides.rubyonrails.org/active_record_querying.html#limit-and-offset

@no-reply
Copy link
Contributor Author

I like 'offset' better, in general, but I called it start so it matches Solr. It looks like we're already not matching Solr's parameters on 'order'/'sort', though.

What's the thinking? Better to match AR or Solr? Or should there be an alias?

@tpendragon
Copy link
Contributor

What's the thinking? Better to match AR or Solr? Or should there be an alias?

Consistency is key, and since AF is already matching AR's order/sort my vote's for #offset without an alias.

Solr supports paginated results with the `start` option. This adds that
to the find/query methods.
@mjgiarlo
Copy link
Member

+1 to making Hydra feel more like vanilla Rails and less like niche cultural heritageware.

@no-reply
Copy link
Contributor Author

Done.

jcoyne added a commit that referenced this pull request May 20, 2014
Adding start/offset option for queries
@jcoyne jcoyne merged commit 268b80c into samvera:master May 20, 2014
@no-reply no-reply deleted the feature/query-offset branch May 20, 2014 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants