當前位置: 首頁>>代碼示例>>Java>>正文


Java PreAnalyzedField類代碼示例

本文整理匯總了Java中org.apache.solr.schema.PreAnalyzedField的典型用法代碼示例。如果您正苦於以下問題:Java PreAnalyzedField類的具體用法?Java PreAnalyzedField怎麽用?Java PreAnalyzedField使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PreAnalyzedField類屬於org.apache.solr.schema包,在下文中一共展示了PreAnalyzedField類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: mutate

import org.apache.solr.schema.PreAnalyzedField; //導入依賴的package包/類
@Override
protected SolrInputField mutate(SolrInputField src) {
  SchemaField sf = schema.getFieldOrNull(src.getName());
  if (sf == null) { // remove this field
    return null;
  }
  FieldType type = PreAnalyzedField.createFieldType(sf);
  if (type == null) { // neither indexed nor stored - skip
    return null;
  }
  SolrInputField res = new SolrInputField(src.getName());
  res.setBoost(src.getBoost());
  for (Object o : src) {
    if (o == null) {
      continue;
    }
    Field pre = (Field)parser.createField(sf, o, 1.0f);
    if (pre != null) {
      res.addValue(pre, 1.0f);
    } else { // restore the original value
      log.warn("Could not parse field {} - using original value as is: {}", src.getName(), o);
      res.addValue(o, 1.0f);
    }
  }
  return res;
}
 
開發者ID:europeana,項目名稱:search,代碼行數:27,代碼來源:PreAnalyzedUpdateProcessorFactory.java

示例2: handleIndexableField

import org.apache.solr.schema.PreAnalyzedField; //導入依賴的package包/類
private IndexableField handleIndexableField(SchemaField field, String source, String target, float boost) {
    if (StringUtils.isEmpty(source) || StringUtils.isEmpty(target)) {
        return null;
    }
    FieldType fieldType = PreAnalyzedField.createFieldType(field);
    if (null == fieldType) {
        return null;
    }
    Field indexableField = null;
    if (field.stored()) {
        indexableField = new Field(field.getName(), target, fieldType);
    }
    if (field.indexed()) {
        TokenStream tokenStream = ((MultiLangAnalyzer) this.getAnalyzer()).createComponents(field.getName(),
                new StringReader(source)).getTokenStream();
        if (null != indexableField) {
            indexableField.setTokenStream(tokenStream);
        } else {
            indexableField = new Field(field.getName(), tokenStream, fieldType);
        }
    }
    if (null != indexableField) {
        indexableField.setBoost(boost);
    }
    return indexableField;
}
 
開發者ID:smalldirector,項目名稱:solr-multilingual-analyzer,代碼行數:27,代碼來源:MultiLangField.java

示例3: inform

import org.apache.solr.schema.PreAnalyzedField; //導入依賴的package包/類
@Override
public void inform(SolrCore core) {
  super.inform(core);
  parser = new PreAnalyzedField();
  Map<String,String> args = new HashMap<>();
  if (parserImpl != null) {
    args.put(PreAnalyzedField.PARSER_IMPL, parserImpl);
  }
  parser.init(core.getLatestSchema(), args);
}
 
開發者ID:europeana,項目名稱:search,代碼行數:11,代碼來源:PreAnalyzedUpdateProcessorFactory.java

示例4: inform

import org.apache.solr.schema.PreAnalyzedField; //導入依賴的package包/類
@Override
public void inform(SolrCore core) {
  super.inform(core);
  parser = new PreAnalyzedField();
  Map<String,String> args = new HashMap<String,String>();
  if (parserImpl != null) {
    args.put(PreAnalyzedField.PARSER_IMPL, parserImpl);
  }
  parser.init(core.getLatestSchema(), args);
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:11,代碼來源:PreAnalyzedUpdateProcessorFactory.java

示例5: PreAnalyzedUpdateProcessor

import org.apache.solr.schema.PreAnalyzedField; //導入依賴的package包/類
public PreAnalyzedUpdateProcessor(FieldNameSelector sel, UpdateRequestProcessor next, IndexSchema schema, PreAnalyzedField parser) {
  super(sel, next);
  this.schema = schema;
  this.parser = parser;
}
 
開發者ID:europeana,項目名稱:search,代碼行數:6,代碼來源:PreAnalyzedUpdateProcessorFactory.java


注:本文中的org.apache.solr.schema.PreAnalyzedField類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。