コード例 #1
0
 public FullTextAttribute(DataInclusionOptions option)
 {
     IndexOptions = IndexOptions.Offsets;
     TermVector   = TermVectorOption.WithPositionsOffsets;
     Analyzer     = CustomAnalyzers.EncodedFullTextAnalyzerName;
     if (!DataInclusion.HasOption(option))
     {
         Ignore = true;
     }
 }
コード例 #2
0
        public DataObjectAttribute(DataInclusionOptions option = DataInclusionOptions.None)
        {
            // Store but don't index object fields at all
            Enabled = false;

            if (!DataInclusion.HasOption(option))
            {
                // Don't store the object at all
                Ignore = true;
            }
        }
コード例 #3
0
        public static DataInclusionOptions GetDataInclusion()
        {
            var dataInclusionValue = Environment.GetEnvironmentVariable("DataInclusion");

            if (!string.IsNullOrEmpty(dataInclusionValue))
            {
                DataInclusionOptions options = DataInclusionOptions.None;
                foreach (var option in dataInclusionValue.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()))
                {
                    options |= (DataInclusionOptions)Enum.Parse(typeof(DataInclusionOptions), option);
                }

                Console.WriteLine("DataInclusion={0}", options);
                return(options);
            }

            return(DataInclusionOptions.Default);
        }
コード例 #4
0
 public static bool HasOption(DataInclusionOptions option)
 {
     return((Options & option) == option);
 }