Package org.apache.lucene.document

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


         Field field = (Field)e.nextElement();                  
         if (field.name().equals("date")) {
           idate=stringdateToInt(field.stringValue());          
         }
         else if (field.name().equals("url")) {
           url=field.stringValue();
         }
         else if (field.name().equals("subType")) {
           subtype=field.stringValue();
         }
         else {
View Full Code Here


         }
         else if (field.name().equals("url")) {
           url=field.stringValue();
         }
         else if (field.name().equals("subType")) {
           subtype=field.stringValue();
         }
         else {
           throw new IOException("Wrong field read.");
         }
      }
View Full Code Here

             
      Enumeration e = doc.fields();
      while (e.hasMoreElements()) {
         Field field = (Field)e.nextElement();
         if (field.name().equals("date")) {
           date=Long.parseLong(field.stringValue());   
         }
         else if (field.name().equals("digest")) {
           digest=field.stringValue();
         }                  
         else if (field.name().equals("url")) {
View Full Code Here

         Field field = (Field)e.nextElement();
         if (field.name().equals("date")) {
           date=Long.parseLong(field.stringValue());   
         }
         else if (field.name().equals("digest")) {
           digest=field.stringValue();
         }                  
         else if (field.name().equals("url")) {
           url=field.stringValue();
         }
         else {
View Full Code Here

         }
         else if (field.name().equals("digest")) {
           digest=field.stringValue();
         }                  
         else if (field.name().equals("url")) {
           url=field.stringValue();
         }
         else {
           throw new IOException("Wrong field read.");
         }
      }
View Full Code Here

        for (Enumeration e=doc.fields();e.hasMoreElements();) {              
          Field field = (Field)e.nextElement();
          if (j!=0) {
            System.out.print(" ");
          }
          System.out.print(field.stringValue());
          //field.name()
          j++;
        }
        System.out.println();
       
View Full Code Here

      else if (fieldable instanceof Field) {
        Field safeField = (Field) fieldable;
        if ( safeField.isBinary() ) {
          serializer.addFieldWithBinaryData( new LuceneFieldContext( safeField ) );
        }
        else if ( safeField.stringValue() != null ) {
          serializer.addFieldWithStringData( new LuceneFieldContext( safeField ) );
        }
        else if ( safeField.readerValue() != null && safeField.readerValue() instanceof Serializable ) {
          serializer.addFieldWithSerializableReaderData( new LuceneFieldContext( safeField ) );
        }
View Full Code Here

   Document doc = reader.document(hit.getIndexDocNo(), (fieldNames==null) ? null : new MapFieldSelector(fieldNames));
   Enumeration e = doc.fields();
   while (e.hasMoreElements()) {
     Field field = (Field)e.nextElement();
     fields.add(field.name());
     values.add(field.stringValue());
   }

   return new HitDetails((String[])fields.toArray(new String[fields.size()]),
                            (String[])values.toArray(new String[values.size()]));
  }   
View Full Code Here

    this.nullMarker = nullMarker;
  }

  public Object get(String name, Document document) {
    Field field = document.getField( name );
    String stringValue = field.stringValue();
    if ( nullMarker.equals( stringValue ) ) {
      return null;
    }
    else {
      return fieldBridge.get( name, document );
View Full Code Here

      else if (fieldable instanceof Field) {
        Field safeField = (Field) fieldable;
        if ( safeField.isBinary() ) {
          serializer.addFieldWithBinaryData( new LuceneFieldContext( safeField ) );
        }
        else if ( safeField.stringValue() != null )  {
          serializer.addFieldWithStringData( new LuceneFieldContext( safeField ) );
        }
        else if ( safeField.readerValue() != null && safeField.readerValue() instanceof Serializable )  {
          serializer.addFieldWithSerializableReaderData( new LuceneFieldContext( safeField ) );
        }
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.