Skip to content

Commit

Permalink
HSEARCH-4336 Deprecate the programmatic mapping equivalent of depreca…
Browse files Browse the repository at this point in the history
…ted @boost annotations
  • Loading branch information
yrodiere committed Oct 11, 2021
1 parent f2c070e commit 4b1ea40
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 0 deletions.
Expand Up @@ -79,6 +79,13 @@ public ClassBridgeMapping termVector(TermVector termVector) {
return this;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public ClassBridgeMapping boost(float boost) {
final Map<String, Object> boostAnn = new HashMap<String, Object>();
boostAnn.put( "value", boost );
Expand Down
Expand Up @@ -91,10 +91,24 @@ public void setCacheInMemory(Map<String, Object> cacheInMemory) {
//No-op: this feature is no longer available
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public void setBoost(Map<String, Object> boost) {
this.boost = boost;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public Map<String, Object> getBoost() {
return boost;
}
Expand Down Expand Up @@ -159,10 +173,24 @@ public Map<String, Object> getProvidedId() {
return this.providedId;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public void setDynamicBoost(Map<String, Object> dynamicEntityBoost) {
this.dynamicBoost = dynamicEntityBoost;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public Map<String, Object> getDynamicBoost() {
return this.dynamicBoost;
}
Expand Down
Expand Up @@ -36,6 +36,13 @@ public EntitySpatialMapping spatial() {
return new EntitySpatialMapping( mapping, entity );
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public EntityMapping boost(float boost) {
final Map<String, Object> boostAnn = new HashMap<String, Object>();
boostAnn.put( "value", boost );
Expand Down
Expand Up @@ -44,6 +44,13 @@ public EntitySpatialMapping store(Store store) {
return this;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public EntitySpatialMapping boost(float boost) {
final Map<String, Object> boostAnn = new HashMap<String, Object>();
boostAnn.put( "value", boost );
Expand Down
Expand Up @@ -63,6 +63,13 @@ public FieldMapping termVector(TermVector termVector) {
return fieldMapping.termVector( termVector );
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public FieldMapping boost(float boost) {
return fieldMapping.boost( boost );
}
Expand Down
Expand Up @@ -101,6 +101,13 @@ public FieldMapping termVector(TermVector termVector) {
return this;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public FieldMapping boost(float boost) {
final Map<String, Object> boostAnn = new HashMap<String, Object>();
boostAnn.put( "value", boost );
Expand Down
Expand Up @@ -81,6 +81,13 @@ public IndexedClassBridgeMapping termVector(TermVector termVector) {
return this;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public IndexedClassBridgeMapping boost(float boost) {
final Map<String, Object> boostAnn = new HashMap<String, Object>();
boostAnn.put( "value", boost );
Expand Down
Expand Up @@ -52,6 +52,13 @@ public IndexedMapping cacheFromIndex(FieldCacheType... type) {
return this;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public IndexedMapping boost(float boost) {
final Map<String, Object> boostAnn = new HashMap<String, Object>();
boostAnn.put( "value", boost );
Expand Down
Expand Up @@ -122,10 +122,24 @@ public void setContainedIn(Map<String, Object> containedIn) {
this.containedIn = containedIn;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public void setDynamicBoost(Map<String, Object> dynamicBoostAnn) {
this.dynamicBoost = dynamicBoostAnn;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public Map<String,Object> getDynamicBoost() {
return this.dynamicBoost;
}
Expand Down
Expand Up @@ -46,6 +46,13 @@ public PropertySpatialMapping store(Store store) {
return this;
}

/**
* @deprecated Index-time boosting will not be possible anymore starting from Lucene 7.
* You should use query-time boosting instead, for instance by calling
* {@link org.hibernate.search.query.dsl.FieldCustomization#boostedTo(float) boostedTo(float)}
* when building queries with the Hibernate Search query DSL.
*/
@Deprecated
public PropertySpatialMapping boost(float boost) {
final Map<String, Object> boostAnn = new HashMap<String, Object>();
boostAnn.put( "value", boost );
Expand Down

0 comments on commit 4b1ea40

Please sign in to comment.