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

Support for nested documents #170

Merged
merged 5 commits into from Jun 28, 2016
Merged

Conversation

skirsdeda
Copy link
Contributor

This makes it possible to add nested documents (documents with children) via Solr.add. Includes tests as well, however {!child} query seems to be buggy in 4.10 so I left it disabled.

One thing worth discussing is the children key in doc dicts. I simply used "children" but maybe some safer option could be used (like 'children' or 'childDocuments' as in Solr's JSON request handler) so that it doesn't accidentally clash with simple fields.

@skirsdeda
Copy link
Contributor Author

Added NESTED_DOC_KEY='childDocuments' instead of hardcoded 'children' to match nested documents. Maybe this is a sensible default since it matches Solr's naming.
Also implementation was messed up previously since it only supported 1-level deep nesting.

So all is good now. Haystack support for nested documents on Solr and Elastic coming up :)

@acdha acdha self-assigned this Oct 5, 2015
@skirsdeda
Copy link
Contributor Author

bump

@skirsdeda
Copy link
Contributor Author

@acdha bump.

@ahankinson
Copy link
Contributor

+1 Would be nice to have this in there.

@acdha acdha added the feature label Feb 16, 2016
@acdha acdha added this to the v4.0.0 milestone Feb 16, 2016
@ahankinson
Copy link
Contributor

Can this be given a higher priority? I'm maintaining my own fork for this (https://github.com/ahankinson/pysolr/tree/fix-child-documents). I'd be happy to contribute it as a new pull request, but support for the _childDocuments_ key would be nice.

acdha added a commit to acdha/pysolr that referenced this pull request Jun 28, 2016
This adds support for Solr's nested documents in `Solr.add`

Thanks to @skirsdeda for the patch
acdha added a commit to acdha/pysolr that referenced this pull request Jun 28, 2016
This adds support for Solr's nested documents in `Solr.add`

Thanks to @skirsdeda for the patch
@acdha
Copy link
Collaborator

acdha commented Jun 28, 2016

@ahankinson Since @skirsdeda sent a nice clean patch, it wasn't hard to update against the current master. The tests are running now: https://travis-ci.org/acdha/pysolr/builds/140901856

@acdha acdha merged commit c14d988 into django-haystack:master Jun 28, 2016
@ahankinson
Copy link
Contributor

fantastic, thank you very much.

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

Successfully merging this pull request may close these issues.

None yet

3 participants