pysolr icon indicating copy to clipboard operation
pysolr copied to clipboard

Add support for named nested documents

Open cokolbe opened this issue 6 years ago • 3 comments

This patch adds support for named nested documents as supported by solr 8, as documented in the reference guide (XML example on page 378).

This in turn will support deeply nested documents as it enables the use of the new solr fields _nest_parent_ and _nest_path_, which enable new query functions.

It's no longer required to name child documents "_doc" or "_childDocument_", they can be any name just like any other tag. The original usage of "_doc" and "_childDocument_" remains usable as before.

Usage example:

solr.add([
    {
        "id": "doc_1",
        "title": "A test document",
    },
    {
        "id": "doc_2",
        "title": "The Banana: Tasty or Dangerous?",
        "comments": [
            { "id": "child_doc_1", "title": "peel" },
            { "id": "child_doc_2", "title": "seed" },
        ]
    },
])

cokolbe avatar Jul 12 '19 13:07 cokolbe

Codecov Report

Merging #271 into master will decrease coverage by 0.55%. The diff coverage is 9.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
- Coverage    94.1%   93.54%   -0.56%     
==========================================
  Files           7        7              
  Lines        1306     1317      +11     
==========================================
+ Hits         1229     1232       +3     
- Misses         77       85       +8
Impacted Files Coverage Δ
pysolr.py 88.04% <9.09%> (-0.98%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c24036f...d484afa. Read the comment docs.

codecov[bot] avatar Jul 12 '19 13:07 codecov[bot]

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]

Can you rebase this against the current master branch and add some tests?

acdha avatar Oct 10 '19 15:10 acdha

Please rebase.

cclauss avatar Apr 26 '23 08:04 cclauss

@cokolbe Please rebase or close.

cclauss avatar Jun 27 '23 16:06 cclauss

This was the only GitHub activity that this user had and they have not been active on the platform for many years.

cclauss avatar Sep 15 '23 16:09 cclauss