Enum Class SearchMatchType

java.lang.Object
java.lang.Enum<SearchMatchType>
ubic.gemma.model.common.search.SearchMatchType
All Implemented Interfaces:
Serializable, Comparable<SearchMatchType>, Constable

public enum SearchMatchType extends Enum<SearchMatchType>
How a SearchResult matched the query — the structured discriminant that a double score cannot carry on its own.

The motivating case: MATCH_BY_OFFICIAL_SYMBOL_INEXACT_SCORE (0.9) and MATCH_BY_ALIAS_SCORE (0.90) are numerically identical, so a client gating on "score < 1.0" cannot tell a safe alias hit (commit) from a bare prefix look-alike (reject). For example the query ANKA (a Plasmodium strain, not a gene) matches Ankar only because ANKA is a prefix of that longer symbol; that hit is SYMBOL_PREFIX and should not be auto-committed, whereas ALIAS and EXACT_SYMBOL are safe. The score alone hides this; the match type surfaces it.

getWireName() tokens match the vocabulary the curation-UI / agent clients expect. Only the kinds Gemma can actually produce are enumerated — there is no edit_distance or substring value because the database gene path never generates those (Levenshtein is a ranking tiebreaker, not a match generator, and a leading-wildcard substring only fires on explicit user syntax).

Author:
poirigui
  • Enum Constant Details

    • EXACT_IDENTIFIER

      public static final SearchMatchType EXACT_IDENTIFIER
      Matched a canonical identifier — numeric primary key, accession, NCBI/Ensembl gene id, dataset/platform short name. High trust; resolves to at most one entity. Corresponds to SearchResult.isExactIdentifierMatch().
    • EXACT_SYMBOL

      public static final SearchMatchType EXACT_SYMBOL
      Exact match on an official gene symbol. High trust.
    • SYMBOL_PREFIX

      public static final SearchMatchType SYMBOL_PREFIX
      Inexact prefix match on an official symbol (SQL LIKE 'foo%'). LOW trust: a short query can be a prefix of an unrelated longer symbol (ANKAAnkar). Treat as a candidate, not a commit, unless the query is itself a registered symbol/alias.
    • ALIAS

      public static final SearchMatchType ALIAS
      Exact match on a registered gene alias/synonym. Safe to commit.
    • OFFICIAL_NAME

      public static final SearchMatchType OFFICIAL_NAME
      Exact match on an official (long) name. Safe to commit.
    • OFFICIAL_NAME_PREFIX

      public static final SearchMatchType OFFICIAL_NAME_PREFIX
      Inexact match on an official name. Lower trust, like SYMBOL_PREFIX.
  • Method Details

    • values

      public static SearchMatchType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SearchMatchType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getWireName

      public String getWireName()
      Stable snake-case token for JSON wire contracts (matches the curation-UI / agent vocabulary).