Package org.apache.lucene.index

Examples of org.apache.lucene.index.IndexableField.stringValue()


      String fldName = fld.name();
      final Document sDoc = reader.document(docID, Collections.singleton(fldName));
      final IndexableField sField = sDoc.getField(fldName);
      if (Field.class.equals(fld.getClass())) {
        assertEquals(fld.binaryValue(), sField.binaryValue());
        assertEquals(fld.stringValue(), sField.stringValue());
      } else {
        assertEquals(fld.numericValue(), sField.numericValue());
      }
    }
    reader.close();
View Full Code Here


                        if(num instanceof Double){
                            ranking = (Double)num;
                        } else if (num != null){
                            ranking = Double.valueOf(num.doubleValue());
                        } else { //num == null
                            String value = field.stringValue();
                            if(value != null){
                                try {
                                    ranking = Double.valueOf(value);
                                } catch (NumberFormatException e) {
                                    ranking = null;
View Full Code Here

  }

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

  @Override
  public Object get(String name, Document document) {
    LegacyCarPlantPK id = new LegacyCarPlantPK();
    IndexableField field = document.getField( name + PLANT_ID );
    id.setPlantId( field.stringValue() );

    field = document.getField( name + CAR_ID );
    id.setCarId( field.stringValue() );
    return id;
  }
View Full Code Here

    LegacyCarPlantPK id = new LegacyCarPlantPK();
    IndexableField field = document.getField( name + PLANT_ID );
    id.setPlantId( field.stringValue() );

    field = document.getField( name + CAR_ID );
    id.setCarId( field.stringValue() );
    return id;
  }

  @Override
  public String objectToString(Object o) {
View Full Code Here

  @Override
  public Object get(String name, Document document) {
    LegacyTirePK id = new LegacyTirePK();
    IndexableField field = document.getField( name + CAR_ID );
    id.setCarId( field.stringValue() );
    field = document.getField( name + TIRE_ID );
    id.setTireId( field.stringValue() );
    return id;
  }
View Full Code Here

  public Object get(String name, Document document) {
    LegacyTirePK id = new LegacyTirePK();
    IndexableField field = document.getField( name + CAR_ID );
    id.setCarId( field.stringValue() );
    field = document.getField( name + TIRE_ID );
    id.setTireId( field.stringValue() );
    return id;
  }

  @Override
  public String objectToString(Object o) {
View Full Code Here

  @Override
  public Object get(String name, Document document) {
    PersonPK id = new PersonPK();
    IndexableField field = document.getField( name + ".firstName" );
    id.setFirstName( field.stringValue() );
    field = document.getField( name + ".lastName" );
    id.setLastName( field.stringValue() );
    return id;
  }
View Full Code Here

  public Object get(String name, Document document) {
    PersonPK id = new PersonPK();
    IndexableField field = document.getField( name + ".firstName" );
    id.setFirstName( field.stringValue() );
    field = document.getField( name + ".lastName" );
    id.setLastName( field.stringValue() );
    return id;
  }

  @Override
  public String objectToString(Object object) {
View Full Code Here

*/
public class TruncateFieldBridge implements FieldBridge {

  public Object get(String name, Document document) {
    IndexableField field = document.getField( name );
    return field.stringValue();
  }

  @Override
  public void set(String name, Object value, Document document, LuceneOptions luceneOptions) {
    String stringValue = (String) value;
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.