当前位置: 首页>>代码示例>>Java>>正文


Java SolrInputField.getBoost方法代码示例

本文整理汇总了Java中org.apache.solr.common.SolrInputField.getBoost方法的典型用法代码示例。如果您正苦于以下问题:Java SolrInputField.getBoost方法的具体用法?Java SolrInputField.getBoost怎么用?Java SolrInputField.getBoost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.solr.common.SolrInputField的用法示例。


在下文中一共展示了SolrInputField.getBoost方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeSolrInputDocument

import org.apache.solr.common.SolrInputField; //导入方法依赖的package包/类
public void writeSolrInputDocument(SolrInputDocument sdoc) throws IOException {
  List<SolrInputDocument> children = sdoc.getChildDocuments();
  int sz = sdoc.size() + (children==null ? 0 : children.size());
  writeTag(SOLRINPUTDOC, sz);
  writeFloat(sdoc.getDocumentBoost());
  for (SolrInputField inputField : sdoc.values()) {
    if (inputField.getBoost() != 1.0f) {
      writeFloat(inputField.getBoost());
    }
    writeExternString(inputField.getName());
    writeVal(inputField.getValue());
  }
  if (children != null) {
    for (SolrInputDocument child : children) {
      writeSolrInputDocument(child);
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:19,代码来源:JavaBinCodec.java

示例2: writeSolrInputDocument

import org.apache.solr.common.SolrInputField; //导入方法依赖的package包/类
public void writeSolrInputDocument(SolrInputDocument sdoc) throws IOException {
  List<SolrInputDocument> children = sdoc.getChildDocuments();
  int sz = sdoc.size() + (children==null ? 0 : children.size());
  writeTag(SOLRINPUTDOC, sz);
  writeFloat(sdoc.getDocumentBoost());
  for (SolrInputField inputField : sdoc.values()) {
    if (inputField.getBoost() != 1.0f) {
      writeFloat(inputField.getBoost());
    }
    writeExternString(inputField.getName());
    writeVal(inputField.getValue());
  }
  if (children != null) {
    for (SolrInputDocument child : sdoc.getChildDocuments()) {
      writeSolrInputDocument(child);
    }
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:JavaBinCodec.java

示例3: writeXML

import org.apache.solr.common.SolrInputField; //导入方法依赖的package包/类
public static void writeXML( SolrInputDocument doc, Writer writer ) throws IOException
{
  writer.write("<doc boost=\""+doc.getDocumentBoost()+"\">");

  for( SolrInputField field : doc ) {
    float boost = field.getBoost();
    String name = field.getName();

    for( Object v : field ) {
      String update = null;

      if (v instanceof Map) {
        // currently only supports a single value
        for (Entry<Object,Object> entry : ((Map<Object,Object>)v).entrySet()) {
          update = entry.getKey().toString();
          v = entry.getValue();
          if (v instanceof Collection) {
            Collection values = (Collection) v;
            for (Object value : values) {
              writeVal(writer, boost, name, value, update);
              boost = 1.0f;
            }
          } else  {
            writeVal(writer, boost, name, v, update);
            boost = 1.0f;
          }
        }
      } else  {
        writeVal(writer, boost, name, v, update);
        // only write the boost for the first multi-valued field
        // otherwise, the used boost is the product of all the boost values
        boost = 1.0f;
      }
    }
  }
  writer.write("</doc>");
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:38,代码来源:ClientUtils.java

示例4: writeSolrInputDocument

import org.apache.solr.common.SolrInputField; //导入方法依赖的package包/类
public void writeSolrInputDocument(SolrInputDocument sdoc) throws IOException {
  writeTag(SOLRINPUTDOC, sdoc.size());
  writeFloat(sdoc.getDocumentBoost());
  for (SolrInputField inputField : sdoc.values()) {
    if (inputField.getBoost() != 1.0f) {
      writeFloat(inputField.getBoost());
    }
    writeExternString(inputField.getName());
    writeVal(inputField.getValue());
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:12,代码来源:JavaBinCodec.java

示例5: writeXML

import org.apache.solr.common.SolrInputField; //导入方法依赖的package包/类
public static void writeXML( SolrInputDocument doc, Writer writer ) throws IOException
{
  writer.write("<doc boost=\""+doc.getDocumentBoost()+"\">");

  for( SolrInputField field : doc ) {
    float boost = field.getBoost();
    String name = field.getName();

    for( Object v : field ) {
      String update = null;

      if (v instanceof Map) {
        // currently only supports a single value
        for (Entry<Object,Object> entry : ((Map<Object,Object>)v).entrySet()) {
          update = entry.getKey().toString();
          v = entry.getValue();
          if (v instanceof Collection) {
            Collection values = (Collection) v;
            for (Object value : values) {
              writeVal(writer, boost, name, value, update);
              boost = 1.0f;
            }
          } else  {
            writeVal(writer, boost, name, v, update);
            boost = 1.0f;
          }
        }
      } else  {
        writeVal(writer, boost, name, v, update);
        // only write the boost for the first multi-valued field
        // otherwise, the used boost is the product of all the boost values
        boost = 1.0f;
      }
    }
  }

  if (doc.hasChildDocuments()) {
    for (SolrInputDocument childDocument : doc.getChildDocuments()) {
      writeXML(childDocument, writer);
    }
  }
  
  writer.write("</doc>");
}
 
开发者ID:europeana,项目名称:search,代码行数:45,代码来源:ClientUtils.java


注:本文中的org.apache.solr.common.SolrInputField.getBoost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。