public FullTextAttribute(DataInclusionOptions option) { IndexOptions = IndexOptions.Offsets; TermVector = TermVectorOption.WithPositionsOffsets; Analyzer = CustomAnalyzers.EncodedFullTextAnalyzerName; if (!DataInclusion.HasOption(option)) { Ignore = true; } }
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; } }
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); }
public static bool HasOption(DataInclusionOptions option) { return((Options & option) == option); }