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

Grouping Multivalued Fields #731

Open
benhill opened this issue Nov 3, 2015 · 2 comments
Open

Grouping Multivalued Fields #731

benhill opened this issue Nov 3, 2015 · 2 comments

Comments

@benhill
Copy link

benhill commented Nov 3, 2015

In the docs, it says that "This can also be used to query multivalued fields, allowing a single item to be in multiple groups."

When I attempt this, the search object renders nil for search.groups.

Here's my code:

searchable do
  string :event_ids, :multiple => true do
      self.events.map{|event| event.id}
    end
end

search = Project.search do
  group do
    event_ids.each do |event_id|
      query event_id do
        with(:event_id, event_id)
      end
    end
  end
end
@benhill
Copy link
Author

benhill commented Feb 22, 2016

Any thoughts here? I can't seem to get any results grouped by queries. Even using the examples in the documentation.

@visitvinoth
Copy link
Contributor

@benhill , For me it works fine. I believe you have event_ids as a separate array. Please add more details if you are still facing this issue.

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

3 participants