FieldNormModifier (Lucene 2.4.1 API)
Keywords: org.apache.lucene.index.FieldNormModifier class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.index
Class FieldNormModifier

    java.lang.Object
      org.apache.lucene.index.FieldNormModifier

    public class FieldNormModifier

extends Object

Given a directory and a list of fields, updates the fieldNorms in place for every document. If Similarity class is specified, uses its lengthNorm method to set norms. If -n command line argument is used, removed field norms, as if `Field.Index`.NO_NORMS was used.

NOTE: This will overwrite any length normalization or field/document boosts.

Constructor Summary
`FieldNormModifier(Directory d, Similarity s)` Constructor for code that wishes to use this class programatically If Similarity is null, kill the field norms.

Method Summary
`static void` | `main(String[] args)` Command Line Execution method.
`void` | `reSetNorms(String field)` Resets the norms for the specified field.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FieldNormModifier

    public FieldNormModifier(Directory d,
                             Similarity s)

  Constructor for code that wishes to use this class programatically If Similarity is null, kill the field norms.

  Parameters:
    `d` - the Directory to modify
    `s` - the Similiary to use (can be null)

Method Detail

### main

    public static void main(String[] args)
                     throws IOException

  Command Line Execution method.

       Usage: FieldNormModifier /path/index  field1 field2 ...

  Throws:
    `IOException`

### reSetNorms

    public void reSetNorms(String field)
                    throws IOException

  Resets the norms for the specified field.

  Opens a new IndexReader on the Directory given to this instance, modifies the norms (either using the Similarity given to this instance, or by using fake norms, and closes the IndexReader.

  Parameters:
    `field` - the field whose norms should be reset
  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.