{"action":"created","issue":{"url":"https://api.github.com/repos/apache/lucenenet/issues/47","labels_url":"https://api.github.com/repos/apache/lucenenet/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/apache/lucenenet/issues/47/comments","events_url":"https://api.github.com/repos/apache/lucenenet/issues/47/events","html_url":"https://github.com/apache/lucenenet/pull/47","id":54437024,"number":47,"title":"Use reference instead of value type to match Lucene's logic","user":{"login":"laimis","id":911757,"avatar_url":"https://avatars.githubusercontent.com/u/911757?v=3","gravatar_id":"","url":"https://api.github.com/users/laimis","html_url":"https://github.com/laimis","followers_url":"https://api.github.com/users/laimis/followers","following_url":"https://api.github.com/users/laimis/following{/other_user}","gists_url":"https://api.github.com/users/laimis/gists{/gist_id}","starred_url":"https://api.github.com/users/laimis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laimis/subscriptions","organizations_url":"https://api.github.com/users/laimis/orgs","repos_url":"https://api.github.com/users/laimis/repos","events_url":"https://api.github.com/users/laimis/events{/privacy}","received_events_url":"https://api.github.com/users/laimis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-15T11:06:14Z","updated_at":"2015-01-15T12:05:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/lucenenet/pulls/47","html_url":"https://github.com/apache/lucenenet/pull/47","diff_url":"https://github.com/apache/lucenenet/pull/47.diff","patch_url":"https://github.com/apache/lucenenet/pull/47.patch"},"body":"Introduce a nullable long in DocValuesConsumer, instead of using just long. The need for this is best illustrated if you look at the changes in Lucene45DocValuesConsumer and in NumericDocValuesWriter. The Writer had iterator implementation that did not match Lucene version, ignoring cases of DocsWithField.Get(doc) evaluating to false in which case a null value needs to be returned. Null value executes a code branch in Lucene45DocValuesConsumer that was simply ignored before. The result of that is the resulting index structure being incorrect, and requests such as DocsWithFields would return true for all documents even though the index had documents that did not have a field in question. \r\n\r\nThe tests that used to break are in TestLucene45DocValuesFormat and TestPerFieldDocValuesFormat, e.g. BaseDocValuesFormatTestCase.TestTwoNumbersOneMissing. This fixes about 20 failing tests by my count.\r\n\r\nI was considering porting over Numeric class over, but I think we can do that in stages, if necessary. Since all the signatures were using long, migrating to long? was the first step to get the logic right and tests passing. And then we can improve on the approach itself.\r\n\r\nI think I see more code places where iterators have been ported incorrectly and numbers are used in non-nullable form causing different code execution paths, but will get those as we go down the list of failing tests."},"comment":{"url":"https://api.github.com/repos/apache/lucenenet/issues/comments/70076543","html_url":"https://github.com/apache/lucenenet/pull/47#issuecomment-70076543","issue_url":"https://api.github.com/repos/apache/lucenenet/issues/47","id":70076543,"user":{"login":"synhershko","id":212252,"avatar_url":"https://avatars.githubusercontent.com/u/212252?v=3","gravatar_id":"","url":"https://api.github.com/users/synhershko","html_url":"https://github.com/synhershko","followers_url":"https://api.github.com/users/synhershko/followers","following_url":"https://api.github.com/users/synhershko/following{/other_user}","gists_url":"https://api.github.com/users/synhershko/gists{/gist_id}","starred_url":"https://api.github.com/users/synhershko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/synhershko/subscriptions","organizations_url":"https://api.github.com/users/synhershko/orgs","repos_url":"https://api.github.com/users/synhershko/repos","events_url":"https://api.github.com/users/synhershko/events{/privacy}","received_events_url":"https://api.github.com/users/synhershko/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T12:05:30Z","updated_at":"2015-01-15T12:05:30Z","body":"No need to port `Numeric` IMO, all usages I've seen of it mattered only for inheritance which I could get by one way or another."}}