/** * @see org.opencms.search.I_CmsSearchDocument#setBoost(float) */ public void setBoost(float boost) { m_doc.setDocumentBoost(boost); }
SolrInputDocument readDoc(XMLStreamReader parser) throws XMLStreamException { 264 SolrInputDocument doc = new SolrInputDocument(); 265 266 String attrName = ""; 267 for (int i = 0; i < parser.getAttributeCount(); i++) { 268 attrName = parser.getAttributeLocalName(i); 269 if ("boost".equals(attrName)) { 270 doc.setDocumentBoost(Float.parseFloat(parser.getAttributeValue(i))); 271 } else { 272 XmlUpdateRequestHandler.log.warn("Unknown attribute doc/@" + attrName); 273 } 274 } 275 276 StringBuilder text = new StringBuilder(); 277 String name = null; 278 float boost = 1.0f; 279 boolean isNull = false; 280 while (true) { 281 int event = parser.next(); 282 switch (event) { 283 // Add everything to the text 284 case XMLStreamConstants.SPACE: 285 case XMLStreamConstants.CDATA: 286 case XMLStreamConstants.CHARACTERS: 287 text.append(parser.getText());
attrName = parser.getAttributeLocalName(i); if ("boost".equals(attrName)) { doc.setDocumentBoost(Float.parseFloat(parser.getAttributeValue(i))); } else { XmlUpdateRequestHandler.log.warn("Unknown attribute doc/@" + attrName);
private static SolrInputDocument convertToSolrInputDocument( SearchInputDocument doc) { SolrInputDocument solrDoc = new SolrInputDocument( convertToSolrInputFieldMap(doc.getFieldMap())); solrDoc.setDocumentBoost(doc.getDocumentBoost()); return solrDoc; }
private SolrInputDocument listToSolrInputDocument(List<NamedList> namedList) { SolrInputDocument doc = new SolrInputDocument(); for (int i = 0; i < namedList.size(); i++) { NamedList nl = namedList.get(i); if (i == 0) { doc.setDocumentBoost(nl.getVal(0) == null ? 1.0f : (Float) nl.getVal(0)); } else { doc.addField((String) nl.getVal(0), nl.getVal(1), nl.getVal(2) == null ? 1.0f : (Float) nl.getVal(2)); } } return doc; }
private SolrInputDocument listToSolrInputDocument(List<NamedList> namedList) { SolrInputDocument doc = new SolrInputDocument(); for (int i = 0; i < namedList.size(); i++) { NamedList nl = namedList.get(i); if (i == 0) { doc.setDocumentBoost(nl.getVal(0) == null ? 1.0f : (Float) nl.getVal(0)); } else { doc.addField((String) nl.getVal(0), nl.getVal(1), nl.getVal(2) == null ? 1.0f : (Float) nl.getVal(2)); } } return doc; }
inputDocument.setDocumentBoost(documentBoost);
inputDocument.setDocumentBoost(documentBoost);
public SolrInputDocument readSolrInputDocument(DataInputInputStream dis) throws IOException { int sz = readVInt(dis); float docBoost = (Float)readVal(dis); SolrInputDocument sdoc = new SolrInputDocument(); sdoc.setDocumentBoost(docBoost); for (int i = 0; i < sz; i++) { float boost = 1.0f; String fieldName; Object obj = readVal(dis); // could be a boost, a field name, or a child document if (obj instanceof Float) { boost = (Float)obj; fieldName = (String)readVal(dis); } else if (obj instanceof SolrInputDocument) { sdoc.addChildDocument((SolrInputDocument)obj); continue; } else { fieldName = (String)obj; } Object fieldVal = readVal(dis); sdoc.setField(fieldName, fieldVal, boost); } return sdoc; }
solrDocument.setDocumentBoost(indexDocument.getBoost());