[ https://issues.apache.org/jira/browse/LUCENE-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Miller updated LUCENE-1748: -------------------------------- Attachment: LUCENE-1748.patch I don't like to make these back compat calls, but it seems this was a big break and we are breaking jar drop in anyway, so its a nice chance to just kind of correct things. This patch is a first draft at resolving the two main issues I'm concerned about: 1. PayloadSpans is dropped and moved to Spans. Back compat was so out the window anyway, its much better to just make users with custom SpanQuerys implement the new methods. You can always return unavailable payload, and empty payload set, or even not implement and avoid the functionality. 2. Add a constructor arg to turn off payload collecting for an ordered spannear - it did not lazy load as the payloads javadoc said - the others do, but not ordered spanear. This should let you ignore the new functionality if you don't want to implement - without this, if you had payloads but didn't want to implement, this would blow up at just the sight of payloads. Even if you didn't have a custom SpanQuery to worry about, the query would be much slower if you had payloads but didnt need the query to interact with them - they would be loaded anyway (and its not even always efficient loading - sometimes it has to load a few uneeded payloads that later get dropped) - so you need a way to turn off loading. > getPayloadSpans on org.apache.lucene.search.spans.SpanQuery should be abstract > ------------------------------------------------------------------------------ > > Key: LUCENE-1748 > URL: https://issues.apache.org/jira/browse/LUCENE-1748 > Project: Lucene - Java > Issue Type: Bug > Components: Query/Scoring > Affects Versions: 2.4, 2.4.1 > Environment: all > Reporter: Hugh Cayless > Fix For: 2.9, 3.0, 3.1 > > Attachments: LUCENE-1748.patch > > > I just spent a long time tracking down a bug resulting from upgrading to > Lucene 2.4.1 on a project that implements some SpanQuerys of its own and was > written against 2.3. Since the project's SpanQuerys didn't implement > getPayloadSpans, the call to that method went to SpanQuery.getPayloadSpans > which returned null and caused a NullPointerException in the Lucene code, far > away from the actual source of the problem. > It would be much better for this kind of thing to show up at compile time, I > think. > Thanks! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org