Skip to content

Commit

Permalink
Changes to views and analyzers for 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
tjoubert committed Sep 30, 2022
1 parent 09ffa4f commit 05bee2c
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 7 deletions.
42 changes: 38 additions & 4 deletions arangodb-net-standard/AnalyzerApi/Models/AnalyzerProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class AnalyzerProperties
/// When false, accented characters are converted to
/// their base characters.
/// </summary>
public bool Accent { get; set; }
public bool? Accent { get; set; }

/// <summary>
/// A locale in the format language[_COUNTRY][.encoding][@variant]
Expand Down Expand Up @@ -54,7 +54,7 @@ public class AnalyzerProperties
/// which supports the languages listed at:
/// https://www.arangodb.com/docs/stable/analyzers.html#stemming
/// </summary>
public bool Stemming { get; set; }
public bool? Stemming { get; set; }

/// <summary>
/// Introduced in 3.10. for minHash analyzers.
Expand All @@ -69,9 +69,43 @@ public class AnalyzerProperties
/// <summary>
/// Introduced in 3.10. for minHash analyzers.
/// Specifies the size of min hash signature.
/// Must be greater or equal to 1. Signature
/// size defines probabilistic error.
/// Must be greater or equal to 1.
/// The signature size defines the probalistic
/// error (err = rsqrt(numHashes)). For an error
/// amount that does not exceed 5% (0.05), use a
/// size of 1 / (0.05 * 0.05) = 400.
/// </summary>
public int? NumHashes { get; set; }

/// <summary>
/// Introduced in 3.10. The on-disk path to
/// the trained fastText supervised model.
/// Note: if you are running this in an
/// ArangoDB cluster, this model must
/// exist on every machine in the cluster.
/// Required for classification and
/// nearest_neighbors analyzers.
/// </summary>
public string Model_Location { get; set; }

/// <summary>
/// Introduced in 3.10. The number of class
/// labels that will be produced per input
/// (default: 1).
/// Optional for classification and
/// nearest_neighbors analyzers.
/// </summary>
public int? Top_K { get; set; }

/// <summary>
/// Introduced in 3.10. The probability
/// threshold for which a label will be
/// assigned to an input. A fastText model
/// produces a probability per class label,
/// and this is what will be filtered
/// (default: 0.99).
/// Optional for Classification analyzers.
/// </summary>
public decimal? Threshold { get; set; }
}
}
43 changes: 43 additions & 0 deletions arangodb-net-standard/ViewApi/Models/SearchAliasIndex.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace ArangoDBNetStandard.ViewApi.Models
{
public class SearchAliasIndex
{
/// <summary>
/// Possible value for <see cref="Operation"/>
/// </summary>
public const string SearchAliasIndexAddOperation = "add";

/// <summary>
/// Possible value for <see cref="Operation"/>
/// </summary>
public const string SearchAliasIndexDelOperation = "del";

/// <summary>
/// Possible value for <see cref="Operation"/>
/// </summary>
public const string SearchAliasIndexNoOperation = "";

/// <summary>
/// Name of the collection
/// </summary>
public string Collection { get; set; }

/// <summary>
/// Name of the index
/// </summary>
public string Index { get; set; }

/// <summary>
/// Optional. Type of operation.
/// Possible values:
/// <see cref="SearchAliasIndexAddOperation"/>,
/// <see cref="SearchAliasIndexDelOperation"/>, or
/// <see cref="SearchAliasIndexNoOperation"/>
/// </summary>
public string Operation { get; set; }
}
}
12 changes: 9 additions & 3 deletions arangodb-net-standard/ViewApi/Models/ViewDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ViewDetails
/// (default: 2, to disable use: 0).
/// Read more about this in the documentation.
/// </summary>
public int CleanupIntervalStep { get; set; }
public int? CleanupIntervalStep { get; set; }

/// <summary>
/// The number of milliseconds to wait
Expand All @@ -57,7 +57,7 @@ public class ViewDetails
/// to queries (default: 1000, to disable use: 0)
/// Read more about this in the documentation.
/// </summary>
public int CommitIntervalMsec { get; set; }
public int? CommitIntervalMsec { get; set; }

/// <summary>
/// The number of milliseconds to wait
Expand All @@ -67,7 +67,7 @@ public class ViewDetails
/// (default: 10000, to disable use: 0).
/// Read more about this in the documentation.
/// </summary>
public int ConsolidationIntervalMsec { get; set; }
public int? ConsolidationIntervalMsec { get; set; }

/// <summary>
/// The consolidation policy to apply
Expand Down Expand Up @@ -132,5 +132,11 @@ public class ViewDetails
/// and the link properties as attribute values.
/// </summary>
public IDictionary<string, LinkProperties> Links { get; set; }

/// <summary>
/// Introduced in 3.10. List of indexes for
/// search-alias views.
/// </summary>
public List<SearchAliasIndex> Indexes { get; set; }
}
}

0 comments on commit 05bee2c

Please sign in to comment.