@Field(name = "givenNameExact", analyzer = @Analyzer(definition = LuceneAnalyzers.EXACT_ANALYZER), boost = @Boost(8f)), @Field(name = "givenNameStart", analyzer = @Analyzer(definition = LuceneAnalyzers.START_ANALYZER), boost = @Boost(4f)), @Field(name = "givenNameAnywhere", analyzer = @Analyzer(definition = LuceneAnalyzers.ANYWHERE_ANALYZER), boost = @Boost(2f)) }) private String givenName; @Field(name = "middleNameExact", analyzer = @Analyzer(definition = LuceneAnalyzers.EXACT_ANALYZER), boost = @Boost(4f)), @Field(name = "middleNameStart", analyzer = @Analyzer(definition = LuceneAnalyzers.START_ANALYZER), boost = @Boost(2f)), @Field(name = "middleNameAnywhere", analyzer = @Analyzer(definition = LuceneAnalyzers.ANYWHERE_ANALYZER)) }) @Field(name = "familyNameExact", analyzer = @Analyzer(definition = LuceneAnalyzers.EXACT_ANALYZER), boost = @Boost(8f)), @Field(name = "familyNameStart", analyzer = @Analyzer(definition = LuceneAnalyzers.START_ANALYZER), boost = @Boost(4f)), @Field(name = "familyNameAnywhere", analyzer = @Analyzer(definition = LuceneAnalyzers.ANYWHERE_ANALYZER), boost = @Boost(2f)), }) private String familyName; @Field(name = "familyName2Exact", analyzer = @Analyzer(definition = LuceneAnalyzers.EXACT_ANALYZER), boost = @Boost(4f)), @Field(name = "familyName2Start", analyzer = @Analyzer(definition = LuceneAnalyzers.START_ANALYZER), boost = @Boost(2f)), @Field(name = "familyName2Anywhere", analyzer = @Analyzer(definition = LuceneAnalyzers.ANYWHERE_ANALYZER)), })
private float getBoost(XClass element) { float boost = 1.0f; if ( element == null ) { return boost; } Boost boostAnnotation = element.getAnnotation( Boost.class ); if ( boostAnnotation != null ) { boost = boostAnnotation.value(); } return boost; }
@Field(name = "valuePhrase", analyzer = @Analyzer(definition = LuceneAnalyzers.PHRASE_ANALYZER), boost = @Boost(8f)), @Field(name = "valueExact", analyzer = @Analyzer(definition = LuceneAnalyzers.EXACT_ANALYZER), boost = @Boost(4f)), @Field(name = "valueStart", analyzer = @Analyzer(definition = LuceneAnalyzers.START_ANALYZER), boost = @Boost(2f)), @Field(name = "valueAnywhere", analyzer = @Analyzer(definition = LuceneAnalyzers.ANYWHERE_ANALYZER)) })
private float getBoost(XClass element) { float boost = 1.0f; if ( element == null ) { return boost; } Boost boostAnnotation = element.getAnnotation( Boost.class ); if ( boostAnnotation != null ) { boost = boostAnnotation.value(); } return boost; }
@Field(name = "identifierPhrase", analyzer = @Analyzer(definition = LuceneAnalyzers.PHRASE_ANALYZER), boost = @Boost(8f)), @Field(name = "identifierExact", analyzer = @Analyzer(definition = LuceneAnalyzers.EXACT_ANALYZER), boost = @Boost(4f)), @Field(name = "identifierStart", analyzer = @Analyzer(definition = LuceneAnalyzers.START_ANALYZER), boost = @Boost(2f)), @Field(name = "identifierAnywhere", analyzer = @Analyzer(definition = LuceneAnalyzers.ANYWHERE_ANALYZER)) })
public static Float getBoost(XProperty member, Annotation fieldAnn) { float computedBoost = 1.0f; Boost boostAnn = member.getAnnotation( Boost.class ); if ( boostAnn != null ) { computedBoost = boostAnn.value(); } if ( fieldAnn != null ) { float boost; if ( fieldAnn instanceof org.hibernate.search.annotations.Field ) { boost = ( (org.hibernate.search.annotations.Field) fieldAnn ).boost().value(); } else if ( fieldAnn instanceof Spatial ) { boost = ( (Spatial) fieldAnn ).boost().value(); } else { raiseAssertionOnIncorrectAnnotation( fieldAnn ); boost = 0; //never reached } computedBoost *= boost; } return computedBoost; }
public static Float getBoost(XProperty member, Annotation fieldAnn) { float computedBoost = 1.0f; Boost boostAnn = member.getAnnotation( Boost.class ); if ( boostAnn != null ) { computedBoost = boostAnn.value(); } if ( fieldAnn != null ) { float boost; if ( fieldAnn instanceof org.hibernate.search.annotations.Field ) { boost = ( (org.hibernate.search.annotations.Field) fieldAnn ).boost().value(); } else if ( fieldAnn instanceof Spatial ) { boost = ( (Spatial) fieldAnn ).boost().value(); } else { raiseAssertionOnIncorrectAnnotation( fieldAnn ); boost = 0; //never reached } computedBoost *= boost; } return computedBoost; }
@Field(name = "alt_title", store = Store.YES) @Boost(2) public String getTitle() { return title; }
.boost( spatialAnnotation.boost().value() ) .fieldBridge( spatialBridge ) .spatial();
@Field(store = Store.YES) @Boost(2) public String getTitle() { return title; }
.boost( spatialAnnotation.boost().value() ) .fieldBridge( spatialBridge ) .spatial();
@Boost(2.0F) @Field(store = Store.YES) public String getDescription() { return description; }
fieldPath, store, index, termVector .boost( classBridgeAnnotation.boost().value() ) .fieldBridge( fieldBridge );
@Field(store = Store.YES, boost = @Boost(2.0F)) public String getDescription() { return description; }
fieldPath, store, index, termVector .boost( classBridgeAnnotation.boost().value() ) .fieldBridge( fieldBridge );
@Field(store = Store.YES, termVector = TermVector.WITH_POSITION_OFFSETS, boost = @Boost(23f) ) public String getName() { return name; } public void setName(String name) { this.name = name; }
@Fields( { @Field(index=Index.YES, analyze=Analyze.NO, store=Store.NO), @Field(name = "keywordEdgeNGram_res_element", index = Index.YES, store = Store.NO, analyze = Analyze.YES, analyzer = @Analyzer(definition = "keywordEdgeAnalyzer"), boost = @Boost(2)), @Field(name = "tokenEdgeNGram_res_element", index = Index.YES, store = Store.NO, analyze = Analyze.YES, analyzer = @Analyzer(definition = "tokenEdgeAnalyzer")) }) @Column(name = "res_element", nullable = false, length = 500) public String getResElement() { return this.resElement; }
@Fields( { @Field(index=Index.YES, analyze=Analyze.NO, store=Store.NO), @Field(name = "keywordEdgeNGram_syn_synonym", index = Index.YES, store = Store.NO, analyze = Analyze.YES, analyzer = @Analyzer(definition = "keywordEdgeAnalyzer"), boost = @Boost(2)), @Field(name = "tokenEdgeNGram_syn_synonym", index = Index.YES, store = Store.NO, analyze = Analyze.YES, analyzer = @Analyzer(definition = "tokenEdgeAnalyzer")) }) @Column(name = "syn_synonym", nullable = false, length = 500) public String getSynSynonym() { return this.synSynonym; }
@Boost(1.5f) private String name;