pysolr icon indicating copy to clipboard operation
pysolr copied to clipboard

add() does not work properly with nested documents in solr 8

Open cokolbe opened this issue 5 years ago • 5 comments

I have

  • [x] Tested with the latest release
  • [x] Tested with the current master branch
  • [x] Searched for similar existing issues

When adding nested documents with pysolr, it is required to name these child documents "_doc", as per pysolr's usage example. However, since solr 8 it is also possible to explicitly name child documents (Example in the solr reference guide, page 378). This does not appear to be possible with pysolr.

The issue is that this is required for the new fields nest_path and nest_parent (solr reference guide, page 377), which are used for various new features, most importantly the proper retrieval of deeply nested documents (examples at solr reference guide, page 619 f.).

When nested documents (named "_doc") are added with pysolr.add(), neither the nest_path nor nest_parent fields will be filled out by solr, and as such the features using these fields will not work.

When nested documents (given any other name) are added with pysolr.add(), the nested documents/dictionaries will be treated like a single string, so no nesting will happen at all.

Configuration

  • Operating system version: debian 9.9
  • Search engine version: solr 8.1.1
  • Python version: 3.5.3
  • pysolr version: 3.8.1

cokolbe avatar Jul 10 '19 09:07 cokolbe

I've created a pull request to fix this issue.

cokolbe avatar Jul 12 '19 13:07 cokolbe

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 10 '19 13:10 stale[bot]

Are named child documents supported by now? If not I'll gladly help to rebase #271 against the main branch and create a new pull request, although I'm not too familiar with pysolr and it's test suite.

vstollen avatar Oct 23 '20 13:10 vstollen

I am getting the same issue with pysolr latest version. I guess this is still unresolved. Is it a matter of rebasing and adding tests? Not too familiar myself with pysolr's test suite.

spyk avatar Nov 25 '21 11:11 spyk

its still same with 3.9.0

alishah730 avatar Jan 08 '22 19:01 alishah730