Package org.apache.lucene.document

Examples of org.apache.lucene.document.LongField


    doc.add(new Field("utf8", "Lu\uD834\uDD1Ece\uD834\uDD60ne \u0000 \u2620 ab\ud917\udc17cd", customType2));
    doc.add(new Field("content2", "here is more content with aaa aaa aaa", customType2));
    doc.add(new Field("fie\u2C77ld", "field with non-ascii name", customType2));
    // add numeric fields, to test if flex preserves encoding
    doc.add(new IntField("trieInt", id, Field.Store.NO));
    doc.add(new LongField("trieLong", (long) id, Field.Store.NO));
    // add docvalues fields
    doc.add(new NumericDocValuesField("dvByte", (byte) id));
    byte bytes[] = new byte[] {
      (byte)(id >>> 24), (byte)(id >>> 16),(byte)(id >>> 8),(byte)id
    };
View Full Code Here


  private void toDocField(Document doc, Lucene lucene, Date value) {
    if (value == null) {
      return;
    }
    doc.add(new LongField(lucene.name(), value.getTime(), Store.YES));
  }
View Full Code Here

    }
    doc.add(new LongField(lucene.name(), value.getTime(), Store.YES));
  }

  private void toDocField(Document doc, Lucene lucene, long value) {
    doc.add(new LongField(lucene.name(), value, Store.YES));
  }
View Full Code Here

    doc.add(new Field("utf8", "Lu\uD834\uDD1Ece\uD834\uDD60ne \u0000 \u2620 ab\ud917\udc17cd", customType2));
    doc.add(new Field("content2", "here is more content with aaa aaa aaa", customType2));
    doc.add(new Field("fie\u2C77ld", "field with non-ascii name", customType2));
    // add numeric fields, to test if flex preserves encoding
    doc.add(new IntField("trieInt", id, Field.Store.NO));
    doc.add(new LongField("trieLong", (long) id, Field.Store.NO));
    // add docvalues fields
    doc.add(new NumericDocValuesField("dvByte", (byte) id));
    byte bytes[] = new byte[] {
      (byte)(id >>> 24), (byte)(id >>> 16),(byte)(id >>> 8),(byte)id
    };
View Full Code Here

                    }
                }
                dv = new DateValue(content);
            }
            final long dl = RangeIndexConfigElement.dateToLong(dv);
            return new LongField(fieldName, dl, LongField.TYPE_NOT_STORED);
        } catch (XPathException e) {
            // wrong type: ignore
            LOG.debug("Invalid date format: " + content, e);
        } catch (NumberFormatException e) {
            // wrong type: ignore
View Full Code Here

    document.add( field );
  }

  public void addLongFieldToDocument(String fieldName, long longValue, Document document) {
    checkNotCompressed( fieldName );
    LongField field = new LongField( fieldName, longValue, storeType != Store.NO ? Field.Store.YES : Field.Store.NO );
    setBoost( field );
    document.add( field );
  }
View Full Code Here

              /* (non-Javadoc)
               * @see net.sf.logsaw.core.model.ILogEntryFieldVisitor#visit(net.sf.logsaw.core.model.DateLogEntryField)
               */
              @Override
              public void visit(DateLogEntryField fld) {
                doc.add(new LongField(
                    fld.getKey(), fld.toIndexedValue(entry.get(fld)), Field.Store.YES));
              }
            };
            for (ALogEntryField<?, ?> fld : log.getDialect().getFieldProvider().getAllFields()) {
              if (entry.contains(fld)) {
View Full Code Here

          sf = new StoredField("nf", i);
          typeAnswer = NumericType.INT;
        } else {
          final long l = random().nextLong();
          answer = Long.valueOf(l);
          nf = new LongField("nf", l, Field.Store.NO);
          sf = new StoredField("nf", l);
          typeAnswer = NumericType.LONG;
        }
      }
      doc.add(nf);
View Full Code Here

    final double d = random().nextDouble();

    List<Field> fields = Arrays.asList(
        new Field("bytes", bytes, ft),
        new Field("string", string, ft),
        new LongField("long", l, Store.YES),
        new IntField("int", i, Store.YES),
        new FloatField("float", f, Store.YES),
        new DoubleField("double", d, Store.YES)
    );
View Full Code Here

    doc.add(new Field("utf8", "Lu\uD834\uDD1Ece\uD834\uDD60ne \u0000 \u2620 ab\ud917\udc17cd", customType2));
    doc.add(new Field("content2", "here is more content with aaa aaa aaa", customType2));
    doc.add(new Field("fie\u2C77ld", "field with non-ascii name", customType2));
    // add numeric fields, to test if flex preserves encoding
    doc.add(new IntField("trieInt", id, Field.Store.NO));
    doc.add(new LongField("trieLong", (long) id, Field.Store.NO));
    // add docvalues fields
    doc.add(new NumericDocValuesField("dvByte", (byte) id));
    byte bytes[] = new byte[] {
      (byte)(id >>> 24), (byte)(id >>> 16),(byte)(id >>> 8),(byte)id
    };
View Full Code Here

TOP

Related Classes of org.apache.lucene.document.LongField

Copyright © 2018 www.massapicom. 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.