org.apache.lucene.document.Field.setValue()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.apache.lucene.document.Field.setValue()方法的一些代码示例,展示了Field.setValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.setValue()方法的具体详情如下:
包路径:org.apache.lucene.document.Field
类名称:Field
方法名:setValue

Field.setValue介绍

[英]Expert: change the value of this field. See setValue(String).
[中]专家:更改此字段的值。见setValue(String)

代码示例

代码示例来源:origin: bbejeck/guava-blog

private  void setFieldData(String[] data, Field[] fields) {
  int index = 0;
  for (Field field : fields) {
    field.setValue(data[index++]);
  }
}

代码示例来源:origin: crosswire/jsword

/**
 * Add the text to the Field and put the Field in the document,
 * ignoring null and empty text.
 * 
 * @param doc The Document to which the Field should be added
 * @param field The Field to add
 * @param text The text for the field
 */
private void addField(Document doc, Field field, String text) {
  if (text != null && text.length() > 0) {
    field.setValue(text);
    doc.add(field);
  }
}

代码示例来源:origin: wonder.eof/ERIndexing

public void takeValueForKey(Object value, String key) {
  _document.getField(key).setValue(key);
}

代码示例来源:origin: tamingtext/book

id.setValue(category + "-" + lineCount++);
categoryField.setValue(category);
contentField.setValue(parts[1]);
d.add(id);
d.add(categoryField);

代码示例来源:origin: tamingtext/book

id.setValue(category + "-" + lineCount);
categoryField.setValue(category);
contentField.setValue(content.toString());
d.add(id);
d.add(categoryField);

代码示例来源:origin: org.eclipse.mylyn.tasks.index/core

private void addIndexedAttribute(Document document, AbstractTaskSchema.Field indexField, Date date) {
  if (date == null) {
    return;
  }
  // FIXME: date tools converts dates to GMT, and we don't really want that.  So
  // move the date by the GMT offset if there is any
  String value = DateTools.dateToString(date, Resolution.HOUR);
  Field field = document.getField(indexField.getIndexKey());
  if (field == null) {
    field = new Field(indexField.getIndexKey(), value, Store.YES,
        org.apache.lucene.document.Field.Index.ANALYZED);
    document.add(field);
  } else {
    field.setValue(value);
  }
}

代码示例来源:origin: org.eclipse.mylyn.tasks.index/core

private void addIndexedAttribute(Document document, AbstractTaskSchema.Field indexField, String value) {
  if (value == null) {
    return;
  }
  Field field = document.getField(indexField.getIndexKey());
  if (field == null) {
    field = new Field(indexField.getIndexKey(), value, Store.YES,
        org.apache.lucene.document.Field.Index.ANALYZED);
    document.add(field);
  } else {
    String existingValue = field.stringValue();
    if (!indexField.equals(FIELD_PERSON) || !existingValue.contains(value)) {
      field.setValue(existingValue + " " + value); //$NON-NLS-1$
    }
  }
}

代码示例来源:origin: google/sagetv

long start = Sage.time();
id.setValue(Integer.toString(s.getID()));
title.setValue(s.getTitle());
desc.setValue(s.getDesc());
ep.setValue(s.getEpisodeName());
year.setValue(s.getYear());
rated.setValue(s.getRated());
peeps.setValue((buff.length() > 0) ? buff.toString() : emptyString);
categories.setValue((buff.length() > 0) ? buff.toString() : emptyString);
ers.setValue((buff.length() > 0) ? buff.toString() : emptyString);
bonuses.setValue((buff.length() > 0) ? buff.toString() : emptyString);

代码示例来源:origin: google/sagetv

Person perp = (Person) trans;
long start = Sage.time();
id.setValue(Integer.toString(perp.id));
name.setValue(perp.getName());
try {
 writer.addDocument(doc);

代码示例来源:origin: crosswire/jsword

keyField.setValue(subkey.getOsisRef());
doc.add(keyField);

代码示例来源:origin: org.dspace.dependencies.solr/dspace-solr-core

field.setValue((String)val);
val = ft.toObject(field);

相关文章