|
[
Permlink
| « Hide
]
Yonik Seeley added a comment - 22/Jun/06 01:49 AM
I'll work up a quick patch to revert those APIs and add new ones for Fieldable.
OK, here's the quick'n'dirty version that passes lucene unit tests.
Yonik Seeley made changes - 22/Jun/06 02:20 AM
I just verified that Solr now compiles/works correctly again with this patch.
Any objections to committing it? I think there is a typo of getFielables on Document.java, other than that looks good.
Committed (with typo fixes
The main point for me was to return backward compatibility of getField(s)
Yonik Seeley made changes - 22/Jun/06 02:50 AM
I'm late to the discussion and have only read the patch file, but it seems invalid to me. Won't getField() get a class cast exception when it encounters a Fieldable that is not a Field? The semantics of getField() would have to be something like, "only get this field if it is a Field rather than some other kind of Fieldable", which means it would have to do type testing on the members of fields.
I think it is much better to remove this patch and leave Fieldable as is. Searchable was the same kind of thing. IndexReader is an abstract super class for the different types of readers. When I did ParallelWriter, I had the same problem and had to introduce Writable since IndexWriter is not an abstract class and ParallelWriter is a different implementation. I think it is best to introduce all the abstract classes now for fundamental types that have multiple implementations. Chuck > I'm late to the discussion
Yes, I didn't leave much time for debate > but it seems invalid to me. Won't getField() get a class cast exception Yes, as I noted here: > it would have to do type testing on the members of fields. The JVM does this for us > Searchable was the same kind of thing. I don't recall if it did breack backward compatibility, but even so... how many people write their own Searchers/IndexReaders vs how many people call Document.getField()? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||