[jira] Issue Comment Edited: (LUCENE-1909) Make IndexReader.DEFAULT_TERMS_INDEX_DIVISOR public
[ https://issues.apache.org/jira/browse/LUCENE-1909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12776997#action_12776997 ] Grant Ingersoll edited comment on LUCENE-1909 at 11/12/09 1:49 PM: --- Boy, I had an awesome use case when I wrote this up, but am forgetting it now. I think it was something like: If you are examining the index ahead of time, you could have heuristics about how much memory you want the system to use when loading a reader. Thus, I could have a clause in my IndexReader code that did something like: {code} if (index is big or memory is tight){ reader = IndexReader.open(..., largerTermsIndexDiv); } else{ reader = IndexReader.opent(..., DEFAULT_TERMS_INDEX_DIVISOR); } {code} Hard coding a 1 in that else clause seems like a bad thing to do given there is already a default value spec. by Lucene. Also, since it is package private, if I extend IndexReader, I won't have access to it. At the end of the day, it's not a big deal. was (Author: gsingers): Boy, I had an awesome use case when I wrote this up, but am forgetting it now. I think it was something like: If you are examining the index ahead of time, you could have heuristics about how much memory you want the system to use when loading a reader. Thus, I could have a clause in my IndexReader code that did something like: {code} if (index is big){ reader = IndexReader.open(..., largerTermsIndexDiv); } else{ reader = IndexReader.opent(..., DEFAULT_TERMS_INDEX_DIVISOR); } {code} Hard coding a 1 in that else clause seems like a bad thing to do given there is already a default value spec. by Lucene. Also, since it is package private, if I extend IndexReader, I won't have access to it. At the end of the day, it's not a big deal. Make IndexReader.DEFAULT_TERMS_INDEX_DIVISOR public --- Key: LUCENE-1909 URL: https://issues.apache.org/jira/browse/LUCENE-1909 Project: Lucene - Java Issue Type: Improvement Reporter: Grant Ingersoll Assignee: Uwe Schindler Priority: Trivial Fix For: 3.0 Attachments: LUCENE_1909.patch -- 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
[jira] Issue Comment Edited: (LUCENE-1909) Make IndexReader.DEFAULT_TERMS_INDEX_DIVISOR public
[ https://issues.apache.org/jira/browse/LUCENE-1909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12777112#action_12777112 ] Mark Miller edited comment on LUCENE-1909 at 11/12/09 6:47 PM: --- heh - well, if you want to be lazy with the admin code, you can just plug in 1. Do you really need a Lucene constant to tell you that a divisor of 1 is no divisor? eg - Lucene is not using that default in a way that you guys are arguing users would want to - its using it to set the thing as off. Perhaps it shouldnt have default in its name - being internal, it kind of doesn't matter though. Really its just saying, the divisor is off. You don't really need to worry about what the number is - its just avoiding a magic number in Lucene code. eg - there is no default number as far as the user should be concerned. The default is that the IndexReader divisor feature is off. was (Author: markrmil...@gmail.com): heh - well, if you want to be lazy with the admin code, you can just plug in 1. Do you really need a Lucene constant to tell you that a divisor of 1 is no divisor? eg - Lucene is not using that default in a way that you guys are arguing users would want to - its using it to set the thing as off. Perhaps it shouldnt have default in its name - being internal, it kind of doesn't matter though. Really its just saying, the divisor is off. You don't really need to worry about what the number is - its just avoiding a magic number in Lucene code. Make IndexReader.DEFAULT_TERMS_INDEX_DIVISOR public --- Key: LUCENE-1909 URL: https://issues.apache.org/jira/browse/LUCENE-1909 Project: Lucene - Java Issue Type: Improvement Reporter: Grant Ingersoll Assignee: Uwe Schindler Priority: Trivial Fix For: 3.0 Attachments: LUCENE_1909.patch -- 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
[jira] Issue Comment Edited: (LUCENE-1909) Make IndexReader.DEFAULT_TERMS_INDEX_DIVISOR public
[ https://issues.apache.org/jira/browse/LUCENE-1909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12777116#action_12777116 ] Uwe Schindler edited comment on LUCENE-1909 at 11/12/09 6:54 PM: - By the way, if you use a final constant, without recompiling it would never change, because even Java puts such constants directly as plain value into class files... :-) - so a change in the JAR file of a new Lucene Version would have no effect. See the problem with Constants.LUCENE_MAIN_VERSION (which is solved from 2.9.1 on) was (Author: thetaphi): By the way, if you use a final constant, without recompiling it would never change, because even Java puts such constants directly as plain value into class files... :-) See the problem with Constants.LUCENE_MAIN_VERSION Make IndexReader.DEFAULT_TERMS_INDEX_DIVISOR public --- Key: LUCENE-1909 URL: https://issues.apache.org/jira/browse/LUCENE-1909 Project: Lucene - Java Issue Type: Improvement Reporter: Grant Ingersoll Assignee: Uwe Schindler Priority: Trivial Fix For: 3.0 Attachments: LUCENE_1909.patch -- 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