Record Class CortexProperties.Search

java.lang.Object
java.lang.Record
ai.chatur.cortex.spring.CortexProperties.Search
Record Components:
viewHalfLife - how long it takes a view's contribution to that weight to halve, so recent interest counts for more than interest that has since faded. Set to 0 to disable decay entirely and weight by the raw lifetime view count instead — in which case a resource popular long ago outranks a newer one indefinitely. Changing this takes effect immediately; no stored history is rewritten.
Enclosing class:
CortexProperties

public static record CortexProperties.Search(Duration viewHalfLife) extends Record
Settings for full-text search ranking.

Search results are ranked by textual relevance, then weighted by how often each resource has been deliberately opened, so a frequently consulted resource outranks an equally relevant one nobody reads. That weight is bounded, so popularity reorders comparable results rather than overriding relevance.

  • Constructor Details

    • Search

      public Search(@DefaultValue("30d") Duration viewHalfLife)
      Creates an instance of a Search record class.
      Parameters:
      viewHalfLife - the value for the viewHalfLife record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • viewHalfLife

      public Duration viewHalfLife()
      Returns the value of the viewHalfLife record component.
      Returns:
      the value of the viewHalfLife record component