[ https://issues.apache.org/jira/browse/LUCENE-4106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288460#comment-13288460 ]
selckin edited comment on LUCENE-4106 at 6/4/12 9:58 AM: --------------------------------------------------------- But then if you wish to loop over all DoubleField values you need to know to do that check yourself? {code} Terms terms = reader.terms(field); TermsEnum termsEnum = terms.iterator(null); BytesRef term = termsEnum.next(); if (term != null) { double min = FieldCache.NUMERIC_UTILS_DOUBLE_PARSER.parseDouble(term); double max = min; try { while ((term = termsEnum.next()) != null) { max = FieldCache.NUMERIC_UTILS_DOUBLE_PARSER.parseDouble(term); } } catch (StopFillCacheException ignored) { } doSomething(min, max); } {code} Or am i indexing something wrong to hit that exception? (i don't think i am) was (Author: selckin): But then if you wish to loop over all DoubleField values you need to know to do that check yourself? {{code}} Terms terms = reader.terms(field); TermsEnum termsEnum = terms.iterator(null); BytesRef term = termsEnum.next(); if (term != null) { double min = FieldCache.NUMERIC_UTILS_DOUBLE_PARSER.parseDouble(term); double max = min; try { while ((term = termsEnum.next()) != null) { max = FieldCache.NUMERIC_UTILS_DOUBLE_PARSER.parseDouble(term); } } catch (StopFillCacheException ignored) { } doSomething(min, max); } {{code}} Or am i indexing something wrong to hit that exception? (i don't think i am) > StopFillCacheException is defined twice and the one is actually thrown is > private and not catchable > --------------------------------------------------------------------------------------------------- > > Key: LUCENE-4106 > URL: https://issues.apache.org/jira/browse/LUCENE-4106 > Project: Lucene - Java > Issue Type: Bug > Reporter: selckin > Assignee: Uwe Schindler > > {code} > lucene/core/src/java/org/apache/lucene/search/FieldCacheImpl.java > 145: static final class StopFillCacheException extends RuntimeException { > 383: } catch (StopFillCacheException stop) { > 456: } catch (StopFillCacheException stop) { > 560: } catch (StopFillCacheException stop) { > 710: } catch (StopFillCacheException stop) { > 798: } catch (StopFillCacheException stop) { > 887: } catch (StopFillCacheException stop) { > lucene/core/src/java/org/apache/lucene/search/FieldCache.java > 57: public static final class StopFillCacheException extends > RuntimeException { > 216: throw new FieldCacheImpl.StopFillCacheException(); > 232: throw new FieldCacheImpl.StopFillCacheException(); > 248: throw new FieldCacheImpl.StopFillCacheException(); > 264: throw new FieldCacheImpl.StopFillCacheException(); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org