Dragoon013 / luke

Automatically exported from code.google.com/p/luke
0 stars 0 forks source link

Luke should indicate if a field is field or a numeric field. #42

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've modified the fieldFlags() method to append a N if the fieldable is a 
numericfield.

  public static String fieldFlags(Fieldable f) {
    if (f == null) {
      return "-----------";
    }
    StringBuffer flags = new StringBuffer();
    if (f != null && f.isIndexed()) flags.append("I");
    else flags.append("-");
    if (f != null && f.isTokenized()) flags.append("T");
    else flags.append("-");
    if (f != null && f.isStored()) flags.append("S");
    else flags.append("-");
    if (f != null && f.isTermVectorStored()) flags.append("V");
    else flags.append("-");
    if (f != null && f.isStoreOffsetWithTermVector()) flags.append("o");
    else flags.append("-");
    if (f != null && f.isStorePositionWithTermVector()) flags.append("p");
    else flags.append("-");
    if (f != null && f.getOmitTermFreqAndPositions()) flags.append("f");
    else flags.append("-");
    if (f != null && f.getOmitNorms()) flags.append("O");
    else flags.append("-");
    if (f != null && f.isLazy()) flags.append("L");
    else flags.append("-");
    if (f != null && f.isBinary()) flags.append("B");
    else flags.append("-");
    if (f instanceof NumericField) flags.append("N");
    else flags.append("-");
    return flags.toString();
  }

Original issue reported on code.google.com by merke...@gmail.com on 6 Jul 2011 at 2:58

GoogleCodeExporter commented 8 years ago
This sounds like a useful addition, thanks. I modified the list of flags in a 
recent commit to use "N" to mean "with Norms" - it was less confusing than the 
previously used "O", so I decided to use "#" to mark NumericField-s. Committed 
to branch_3x in rev. 76.

Original comment by sig...@gmail.com on 28 Dec 2011 at 3:07