Hmm, which version of Lucene are you using?  Newer versions let you
specify a field...

Mike

On Wed, Feb 9, 2011 at 12:06 PM, Pablo Mendes <pablomen...@gmail.com> wrote:
> Guys,
> this is tiny and probably not relevant. But I'll bet a beer that at least a
> dozen people had to dirtymod this class while they could have run it from
> command line.
> A 15 min time save that took 15 min to create. I guess it's a tie.
>
> Best,
> Pablo
>
> --- HighFreqTerms.java
> +++ ExtractStopwords.java
> @@ -30,7 +30,7 @@
>  public class HighFreqTerms {
>
>   // The top numTerms will be displayed
> -  public static final int numTerms = 100;
> +  public static int numTerms = 100;
>
>   public static void main(String[] args) throws Exception {
>     IndexReader reader = null;
> @@ -40,6 +40,10 @@
>     } else if (args.length == 2) {
>       reader = IndexReader.open(args[0]);
>       field = args[1];
> +    } else if (args.length == 3) {
> +      reader = IndexReader.open(args[0]);
> +      field = args[1];
> +      numTerms = new Integer(args[2]);
>     } else {
>       usage();
>       System.exit(1);
> @@ -71,7 +75,7 @@
>   private static void usage() {
>     System.out.println(
>          "\n\n"
> -         + "java org.apache.lucene.misc.HighFreqTerms <index dir>
> [field]\n\n");
> +         + "java org.apache.lucene.misc.HighFreqTerms <index dir> [field]
> [numTerms] \n\n");
>   }
>  }
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to