You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.
What steps will reproduce the problem?
In the following code sample:
var obj1 = new TestRecord { Data = "foo1", Data2 = "bar1" };
var doc1 = LuceneMediator<TestRecord>.ToDocument(obj1);
var obj2 = new TestRecord { Data = "foo2", Data2 = "bar2" };
var doc2 = LuceneMediator<TestRecord>.ToDocument(obj2);
What is the expected output?
I expect doc1 to have Data == "foo1".
What do you see instead?
doc1 is equal to "foo2". If 10,000 of these are done, all ten thousand Document's contain the last processed object's data.
What version of the product are you using?
ActiveLucene.Net_0.1.802.8603
On what operating system?
Windows 7
Please provide any additional information below.
Workaround: Add the Document to the index before using the mediator on another object. This seems to cause the data to get copied out of reach of getting blitzed by the next mediator call. This is the technique I am doing for now. The attribute decorators make a lot of sense, they should add them into the core project.
Suspected Problem: I suspect each Document returned from ToDocument contains a reference to static members within the LuceneMediator class, resulting in all returned Document's ultimately pointing to a single set of property data (from the last processed object). The returned Document needs to be decoupled from the LuceneMediator class.
Original issue reported on code.google.com by [email protected] on 28 May 2011 at 1:38
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 28 May 2011 at 1:38The text was updated successfully, but these errors were encountered: