-
Create an index
solr create -c nested
-
Index two documents, where one is nested.
curl localhost:8983/solr/a/update -d '<add> <doc> <field name="id">friend</field> <field name="type">other</field> </doc> <doc> <field name="id">mother</field> <field name="type">parent</field> <doc> <field name="id">daughter</field> <field name="type">child</field> </doc> </doc> </add>'
-
Search for children of "mother"
curl "localhost:8983/solr/a/query?q=id:mother&fl=%2A%2C%5Bchild%20parentFilter%3Dtype%3Aparent%5D”
You get "friend" mistakenly in the list of children
-
Now index same two docs again, but in opposite order
curl localhost:8983/solr/a/update -d '<add> <doc> <field name="id">mother</field> <field name="type">parent</field> <doc> <field name="id">daughter</field> <field name="type">child</field> </doc> </doc> <doc> <field name="id">friend</field> <field name="type">other</field> </doc> </add>'
-
Search again
curl "localhost:8983/solr/a/query?q=id:mother&fl=%2A%2C%5Bchild%20parentFilter%3Dtype%3Aparent%5D”
You now only get "daughter" as child of "mother"
Why?