Relatude Help

Strings

[StringProperty] has the most options. Here they all are on one property:

[StringProperty(
    Indexed = true,                       // value index: equality, ranges, sorting, facets
    IndexedByWords = true,                // full-text (BM25) index
    IndexedBySemantic = true,             // vector index for semantic search
    PrefixSearch = true,                  // "starts with" search in the word index
    InfixSearch = false,                  // "contains" search in the word index; costs space
    MinWordLength = 3, MaxWordLength = 30,  // words outside these lengths are not indexed
    MinLength = 0, MaxLength = 4000,
    Trim = true,                          // strip white space at both ends, before the rules
    CaseTransform = CaseTransform.ToLowerCase, // or NoTransform, ToUpperCase; after Trim
    LegalCharacters = "abcdefghijklmnopqrstuvwxyz0123456789-",
    RegularExpression = @"^[a-z0-9-]+$",
    RegularExpressionMessage = "Use lower case letters, digits and dashes",
    UniqueValues = true,
    CaseSensitive = false,                // the default: "Ole" and "ole" clash under UniqueValues
    IgnoreDuplicateEmptyValues = true,    // many nodes may be empty under UniqueValues
    NotFacet = false,                     // true keeps an indexed property out of facets
    DefaultValue = ""
)]
public string Slug { get; set; } = string.Empty;

LegalValues = new[] { "draft", "published" } limits the value to a list. StringType says what the text is: AnyString (the default), HTML, Markdown, JSON, JavaScript, TypeScript, CSharp or CSS. StringValueType and CaseTransform are in Relatude.DB.Datamodels.Properties.

Use [HtmlProperty] for rich text. It sets StringType = HTML, so links to nodes and files inside the value keep working when their targets move (§18.2):

[HtmlProperty(IndexedByWords = true, IndexedBySemantic = true)]
public string Description { get; set; } = string.Empty;