tamaramata / solrnet

Automatically exported from code.google.com/p/solrnet
0 stars 0 forks source link

NHibernate Integration - Object reference not set to an instance of an object #168

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Map a Parent & Child object. Parent -< Children, so Parent & Child are 
indexed.
2. Save Parent using NHibernate using cascade='all' or save children 
individually then save parent with cascade='none'
3. Getting various object reference errors either at DoWithEntities or Add and 
I think Delete.

Attached is a test output.

Regards
Kevin Fairclough

Original issue reported on code.google.com by kevin.fa...@gmail.com on 14 Nov 2011 at 10:14

Attachments:

GoogleCodeExporter commented 8 years ago
Can you post the test?

Original comment by mauricio...@gmail.com on 14 Nov 2011 at 12:22

GoogleCodeExporter commented 8 years ago
See attached

Many Thanks
Kevin

Original comment by kevin.fa...@gmail.com on 14 Nov 2011 at 3:15

Attachments:

GoogleCodeExporter commented 8 years ago
Sorry, you will need a field in the schema called Value, or alter the Mappings 
method to use an existing field.

Original comment by kevin.fa...@gmail.com on 14 Nov 2011 at 3:17

GoogleCodeExporter commented 8 years ago
Thanks, fixed in 
https://github.com/mausch/SolrNet/commit/2ba800a17b1a18812d60eba6c4cc01da75f423c
6

However see the comment in 
https://github.com/mausch/SolrNet/blob/2ba800a17b1a18812d60eba6c4cc01da75f423c6/
NHibernate.SolrNet.Tests/IntegrationTests2.cs#L13

Original comment by mauricio...@gmail.com on 14 Nov 2011 at 9:41

GoogleCodeExporter commented 8 years ago
Many Thanks :-)

Yeah in this case of Parent-<Children we would want to flatten into the parent 
object.  However it was our intention to store >1 entity type in the same index 
initially also storing entity type name in the index to allow searching only 
specific types.  I think this is how NHIbernate.Search works, not sure?  Have 
you ever done this, our application needs to search across many types at the 
same time ?

Original comment by kevin.fa...@gmail.com on 15 Nov 2011 at 10:25

GoogleCodeExporter commented 8 years ago
In Solr you should almost always flatten your object graph. Different unrelated 
types means separate cores. Please use the google group for further questions.

Original comment by mauricio...@gmail.com on 15 Nov 2011 at 12:20