当前位置: 首页>>代码示例>>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;未经允许,请勿转载。