Package org.apache.lucene.document

Examples of org.apache.lucene.document.Field.stringValue()


            assertEquals(5, fields.size());
            Field f = (Field) d.getField("id");
            assertEquals(""+i, f.stringValue());

            f = (Field) d.getField("utf8");
            assertEquals("Lu\uD834\uDD1Ece\uD834\uDD60ne \u0000 \u2620 ab\ud917\udc17cd", f.stringValue());

            f = (Field) d.getField("autf8");
            assertEquals("Lu\uD834\uDD1Ece\uD834\uDD60ne \u0000 \u2620 ab\ud917\udc17cd", f.stringValue());
       
            f = (Field) d.getField("content2");
View Full Code Here


            f = (Field) d.getField("utf8");
            assertEquals("Lu\uD834\uDD1Ece\uD834\uDD60ne \u0000 \u2620 ab\ud917\udc17cd", f.stringValue());

            f = (Field) d.getField("autf8");
            assertEquals("Lu\uD834\uDD1Ece\uD834\uDD60ne \u0000 \u2620 ab\ud917\udc17cd", f.stringValue());
       
            f = (Field) d.getField("content2");
            assertEquals("here is more content with aaa aaa aaa", f.stringValue());

            f = (Field) d.getField("fie\u2C77ld");
View Full Code Here

            f = (Field) d.getField("autf8");
            assertEquals("Lu\uD834\uDD1Ece\uD834\uDD60ne \u0000 \u2620 ab\ud917\udc17cd", f.stringValue());
       
            f = (Field) d.getField("content2");
            assertEquals("here is more content with aaa aaa aaa", f.stringValue());

            f = (Field) d.getField("fie\u2C77ld");
            assertEquals("field with non-ascii name", f.stringValue());
          }
        }      
View Full Code Here

       
            f = (Field) d.getField("content2");
            assertEquals("here is more content with aaa aaa aaa", f.stringValue());

            f = (Field) d.getField("fie\u2C77ld");
            assertEquals("field with non-ascii name", f.stringValue());
          }
        }      
      } else
        // Only ID 7 is deleted
        assertEquals(7, i);
View Full Code Here

        }
        if (!decode || val == null) {
          if (f.binaryValue() != null) {
            val = Util.bytesToHex(f.binaryValue(), false);
          } else {
            val = f.stringValue();
          }
        }
        bw.write("<val>" + Util.xmlEscape(val) + "</val>\n");
      }
      Terms tfv = atomicReader.getTermVector(docNum, fieldName);
View Full Code Here

                String text;
                if (f.binaryValue() != null) {
                  text = Util.bytesToHex(f.binaryValue(), true);
                  setBoolean(cbBin, "selected", true);
                } else {
                  text = f.stringValue();
                }
                setString(sText, "text", text);
                setString(fBoost, "text", String.valueOf(f.boost()));
                IndexableFieldType t = f.fieldType();
                setBoolean(cbStored, "selected", t.stored());
View Full Code Here

      for (int i = 0; i < rows.length; i++) {
        Field f = (Field)getProperty(rows[i], "field");
        if (f == null) {
          continue;
        }
        String s = f.stringValue();
        if (s == null || s.trim().length() == 0) {
          continue;
        }
        if (sb.length() > 0) sb.append(" ");
        sb.append(s);
View Full Code Here

      setBoolean(cell, "enabled", false);
    }
    add(row, cell);
    cell = create("cell");
    if (f != null) {
      String text = f.stringValue();
      if (text == null) {
        if (f.binaryValue() != null) {
          text = Util.bytesToHex(f.binaryValue(), false);
        } else {
          text = "(null)";
View Full Code Here

      BytesRef bytes = f.binaryValue();
      data = new byte[bytes.length];
      System.arraycopy(bytes.bytes, bytes.offset, data, 0,
          bytes.length);
    }
    else if (f.stringValue() != null) {
      try {
        data = f.stringValue().getBytes("UTF-8");
      } catch (UnsupportedEncodingException uee) {
        warn = true;
        uee.printStackTrace();
View Full Code Here

      System.arraycopy(bytes.bytes, bytes.offset, data, 0,
          bytes.length);
    }
    else if (f.stringValue() != null) {
      try {
        data = f.stringValue().getBytes("UTF-8");
      } catch (UnsupportedEncodingException uee) {
        warn = true;
        uee.printStackTrace();
        data = f.stringValue().getBytes();
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.