本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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>");
}
示例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());
}
}
示例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>");
}