Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the AnalyzeRequest class.
 /// </summary>
 public AnalyzeRequest(string text, AnalyzerName analyzer = default(AnalyzerName), TokenizerName tokenizer = default(TokenizerName), IList <TokenFilterName> tokenFilters = default(IList <TokenFilterName>), IList <CharFilterName> charFilters = default(IList <CharFilterName>))
 {
     Text         = text;
     Analyzer     = analyzer;
     Tokenizer    = tokenizer;
     TokenFilters = tokenFilters;
     CharFilters  = charFilters;
 }
        /// <summary>
        /// Initializes a new instance of the Field class with required arguments.
        /// </summary>
        /// <param name="name">The name of the field.</param>
        /// <param name="dataType">The data type of the field.</param>
        /// <param name="analyzerName">The name of the analyzer to use for the field.</param>
        /// <remarks>The new field will automatically be searchable.</remarks>
        public Field(string name, DataType dataType, AnalyzerName analyzerName)
            : this(name, dataType != null ? dataType.ToString() : null)
        {
            if (analyzerName == null)
            {
                throw new ArgumentNullException("analyzerName");
            }

            Analyzer     = analyzerName.ToString();
            IsSearchable = true;
        }
        /// <summary>
        /// Initializes a new instance of the Field class with required arguments.
        /// </summary>
        /// <param name="name">The name of the field.</param>
        /// <param name="dataType">The data type of the field.</param>
        /// <param name="analyzerName">The name of the analyzer to use for the field.</param>
        /// <remarks>The new field will automatically be searchable.</remarks>
        public Field(string name, DataType dataType, AnalyzerName analyzerName)
            : this(name, dataType != null ? dataType.ToString() : null)
        {
            if (analyzerName == null)
            {
                throw new ArgumentNullException("analyzerName");
            }

            Analyzer = analyzerName.ToString();
            IsSearchable = true;
        }
 /// <summary>
 /// Creates a new searchable string collection Field with required arguments.
 /// </summary>
 /// <param name="name">The name of the simple field.</param>
 /// <param name="analyzerName">The name of the analyzer to use for the field.</param>
 /// <param name="isKey">A value indicating whether the field uniquely
 /// identifies documents in the index. Default is false.</param>
 /// <param name="isRetrievable">A value indicating whether the field can
 /// be returned in a search result. Default is true.</param>
 /// <param name="isFilterable">A value indicating whether to enable the
 /// field to be referenced in $filter queries. Default is false.</param>
 /// <param name="isFacetable">A value indicating whether to enable the
 /// field to be referenced in facet queries. Default is false.</param>
 /// <param name="synonymMaps">A list of synonym map names that
 /// associates synonym maps with the field. Default is null.</param>
 /// <remarks>The new field will automatically be searchable and of type Collection(Edm.String).</remarks>
 public static Field NewSearchableCollection(
     string name,
     AnalyzerName analyzerName,
     bool isKey                 = false,
     bool isRetrievable         = true,
     bool isFilterable          = false,
     bool isFacetable           = false,
     IList <string> synonymMaps = null) =>
 new Field(name, DataType.Collection(DataType.String), analyzerName)
 {
     IsKey         = isKey,
     IsRetrievable = isRetrievable,
     IsFilterable  = isFilterable,
     IsFacetable   = isFacetable,
     SynonymMaps   = synonymMaps
 };
 /// <summary>
 /// Creates a new searchable string Field with required arguments.
 /// </summary>
 /// <param name="name">The name of the string field.</param>
 /// <param name="analyzerName">The name of the analyzer to use for the simple field.</param>
 /// <param name="isKey">A value indicating whether the field uniquely
 /// identifies documents in the index. Default is false.</param>
 /// <param name="isRetrievable">A value indicating whether the field can
 /// be returned in a search result. Default is true.</param>
 /// <param name="isFilterable">A value indicating whether to enable the
 /// field to be referenced in $filter queries. Default is false.</param>
 /// <param name="isSortable">A value indicating whether to enable the
 /// field to be referenced in $orderby expressions. Default is false.</param>
 /// <param name="isFacetable">A value indicating whether to enable the
 /// field to be referenced in facet queries. Default is false.</param>
 /// <param name="synonymMaps">A list of synonym map names that
 /// associates synonym maps with the field. Default is null.</param>
 /// <remarks>The new field will automatically be searchable and of type Edm.String.</remarks>
 public static Field NewSearchableString(
     string name,
     AnalyzerName analyzerName,
     bool isKey                 = false,
     bool isRetrievable         = true,
     bool isFilterable          = false,
     bool isSortable            = false,
     bool isFacetable           = false,
     IList <string> synonymMaps = null) =>
 new Field(name, analyzerName)
 {
     IsKey         = isKey,
     IsRetrievable = isRetrievable,
     IsFilterable  = isFilterable,
     IsSortable    = isSortable,
     IsFacetable   = isFacetable,
     SynonymMaps   = synonymMaps
 };
 /// <summary>
 /// Initializes a new instance of the Field class with required arguments.
 /// </summary>
 /// <param name="name">The name of the field.</param>
 /// <param name="analyzerName">The name of the analyzer to use for the field.</param>
 /// <remarks>The new field will automatically be searchable and of type Edm.String.</remarks>
 public Field(string name, AnalyzerName analyzerName)
     : this(name, DataType.String, analyzerName)
 {
     // Do nothing.
 }
 /// <summary>
 /// Initializes a new searchable simple Field with required arguments.
 /// </summary>
 /// <param name="name">The name of the simple field.</param>
 /// <param name="dataType">The data type of the field. Cannot be a complex type.</param>
 /// <param name="analyzerName">The name of the analyzer to use for the field.</param>
 /// <exception cref="System.ArgumentException">Thrown if <c>dataType</c> is a complex type.</exception>
 /// <remarks>The new field will automatically be searchable.</remarks>
 public Field(string name, DataType dataType, AnalyzerName analyzerName)
     : this(name, dataType)
 {
     Analyzer     = analyzerName;
     IsSearchable = true;
 }
 /// <summary>
 /// Initializes a new instance of the Field class with required arguments.
 /// </summary>
 /// <param name="name">The name of the field.</param>
 /// <param name="analyzerName">The name of the analyzer to use for the field.</param>
 /// <remarks>The new field will automatically be searchable and of type Edm.String.</remarks>
 public Field(string name, AnalyzerName analyzerName)
     : this(name, DataType.String, analyzerName)
 {
     // Do nothing.
 }