本文整理了Java中org.hibernate.search.bridge.LuceneOptions.getBoost()方法的一些代码示例,展示了LuceneOptions.getBoost()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LuceneOptions.getBoost()方法的具体详情如下:包路径:org.hibernate.search.bridge.LuceneOptions类名称:LuceneOptions方法名:getBoost
LuceneOptions.getBoost介绍
[英]Prefer the use of #addFieldToDocument(String,String,org.apache.lucene.document.Document)over manually building your Field objects and adding them to the Document.[中]宁愿使用#addFieldToDocument(String,String,org.apache.lucene.document.document)也不要手动构建字段对象并将其添加到文档中。
代码示例
代码示例来源:origin: omero/server
public Float getBoost() { if (boost != null) { return boost; } return delegate.getBoost();}
代码示例来源:origin: zanata/zanata-platform
private void addStringField(String fieldName, String fieldValue, Document luceneDocument, LuceneOptions luceneOptions) { FieldType fieldType = translateFieldType(luceneOptions); Field field = new Field(fieldName, fieldValue, fieldType); field.setBoost(luceneOptions.getBoost()); luceneDocument.add(field); }}
代码示例来源:origin: zanata/zanata-platform
private void addStringField(String fieldName, String fieldValue, Document luceneDocument, LuceneOptions luceneOptions) { FieldType fieldType = translateFieldType(luceneOptions); Field field = new Field(fieldName, fieldValue, fieldType); field.setBoost(luceneOptions.getBoost()); luceneDocument.add(field); }}
代码示例来源:origin: zanata/zanata-platform
@Override public void set(String name, Object value, Document document, LuceneOptions luceneOptions) { HProject project = (HProject) value; FieldType fieldType = translateFieldType(luceneOptions); Field field = new Field(PROJECT_FIELD, project.getSlug(), fieldType); field.setBoost(luceneOptions.getBoost()); document.add(field); }}
代码示例来源:origin: zanata/zanata-platform
@Override public void set(String s, Object value, Document document, LuceneOptions luceneOptions) { TransMemoryUnitVariant variant = (TransMemoryUnitVariant) value; String textToIndex = variant.getPlainTextSegment(); FieldType fieldType = translateFieldType(luceneOptions); Field field = new Field(IndexFieldLabels.TRANS_UNIT_VARIANT_FIELD + variant.getLanguage(), textToIndex, fieldType); field.setBoost(luceneOptions.getBoost()); document.add(field); }}
代码示例来源:origin: omero/server
Float boost = opts.getBoost();Store store = opts.getStore();Index index = opts.getIndex();
代码示例来源:origin: omero/server
Float boost = opts.getBoost();if (name != null) { for (Reader parsed : parse(file, files, parsers)) {
代码示例来源:origin: stackoverflow.com
public class MyBridge implements FieldBridge { public void set(String name, Object value, Document document, LuceneOptions luceneOptions) { if (value instanceof List){ for(Object myInt:(List)value){ Field myIntField = new Field(name, myInt.toString(), luceneOptions.getStore(), luceneOptions.getIndex(), luceneOptions.getTermVector()); myIntField.setBoost(luceneOptions.getBoost()); document.add(myIntField); } } }}
代码示例来源:origin: org.kie/drools-infinispan-persistence
@Overridepublic void set(String name, Object value, Document document, LuceneOptions luceneOptions) { if (value != null) { try { TransactionTestObject obj = (TransactionTestObject) value; Long objId = obj.getId(); String objName = obj.getName(); ByteArrayOutputStream baout = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(baout); oout.writeObject(objId); oout.writeUTF(objName); Field field = new Field(name, baout.toByteArray()); field.setBoost(luceneOptions.getBoost()); document.add(field); } catch (Exception e) { throw new RuntimeException("problem bridging SessionInfo", e); } }}
代码示例来源:origin: omero/server
final float reduced_boost = _opts.getBoost().floatValue() / 2;final LuceneOptions opts = new SimpleLuceneOptions(_opts, reduced_boost);
代码示例来源:origin: hibernate/hibernate-search
@Override public void set(String name, Object o, Document document, LuceneOptions luceneOptions) { LegacyCarPlantPK id = (LegacyCarPlantPK) o; Field.Store store = luceneOptions.getStore(); Field.Index index = luceneOptions.getIndex(); Field.TermVector termVector = luceneOptions.getTermVector(); Float boost = luceneOptions.getBoost(); Field field = new Field( name + PLANT_ID, id.getPlantId(), store, index, termVector ); field.setBoost( boost ); document.add( field ); field = new Field( name + CAR_ID, id.getCarId(), store, index, termVector ); field.setBoost( boost ); document.add( field ); }}