public MyIndex_WithoutAnalyzer() { Map = customers => from customer in customers select new { Name = customer.Name }; Indexes.Add(x => x.Name, FieldIndexing.Search); }
public CompaniesR_byName() { Map = companies => from company in companies select new { company.CompanyName }; Indexes.Add(x => x.CompanyName, FieldIndexing.Analyzed); }
public ShoppingCartEventsToShopingCart() { MapDefinition = docs => docs.Where(document => document.For == "ShoppingCart"); GroupByExtraction = source => source.ShoppingCartId; ReduceDefinition = Reduce; Indexes.Add("ShoppingCartId", FieldIndexing.NotAnalyzed); Indexes.Add("Aggregate", FieldIndexing.No); AddField("ShoppingCartId"); AddField("Aggregate"); }
public WorkersR_byEmail() { Map = workers => from worker in workers select new { worker.Email }; Indexes.Add(x => x.Email, FieldIndexing.Analyzed); }
private void SetUp(OpCompositeExtract op, SpirvInstructionTreeBuilder treeBuilder) { ResultType = treeBuilder.ResolveType(op.IdResultType); Composite = treeBuilder.GetNode(op.Composite); foreach (var item in op.Indexes) { Indexes.Add(treeBuilder.Parse(item)); } SetUpDecorations(op, treeBuilder); }
public StoresIndex() { Map = posts => from doc in posts select new { doc.Tags, doc.Content }; Stores.Add(x => x.Title, FieldStorage.Yes); Indexes.Add(x => x.Tags, FieldIndexing.NotAnalyzed); Indexes.Add(x => x.Comments, FieldIndexing.No); }
public Users_ByHobbies() { Map = users => from user in users select new { user.Hobbies }; Indexes.Add(x => x.Hobbies, FieldIndexing.Analyzed); }
public Users_ByName() { Map = users => from u in users select new { Name = u.Name }; Indexes.Add(x => x.Name, FieldIndexing.Analyzed); IndexSuggestions.Add(x => x.Name, new SuggestionOptions()); Stores.Add(x => x.Name, FieldStorage.Yes); }
public Users_ByName() { Map = users => from user in users select new { user.Name }; Indexes.Add(x => x.Name, FieldIndexing.Analyzed); }
protected void Init() { Indexes.Add(IdIndex); Indexes.Add(SubjectIndex); Indexes.Add(AttachmentsIndex); Indexes.Add(BodyIndex); Indexes.Add(HtmlBodyIndex); Indexes.Add(FromIndex); Indexes.Add(AccountIndex); }
public DBColumnList(DBTable table) : base(table) { Indexes.Add(DBColumn.GroupNameInvoker <T> .Instance); Indexes.Add(DBColumn.PropertyNameInvoker <T> .Instance); Indexes.Add(DBColumn.ReferencePropertyNameInvoker <T> .Instance); Indexes.Add(DBColumn.IsViewInvoker <T> .Instance); Indexes.Add(DBColumn.IsReferenceInvoker <T> .Instance); Indexes.Add(DBColumn.ReferenceTableInvoker <T> .Instance); }
public CompaniesR_byEmail() { Map = companies => from company in companies select new { company.Email }; Indexes.Add(x => x.Email, FieldIndexing.Analyzed); }
public WorkersR_byLastName() { Map = workers => from worker in workers select new { worker.LastName }; Indexes.Add(x => x.LastName, FieldIndexing.Analyzed); }
public DocumentTable(DocumentMapping mapping) : base(mapping.TableName) { // validate to ensure document has an Identity field or property mapping.Validate(); _mapping = mapping; var idColumn = new IdColumn(mapping); if (mapping.TenancyStyle == TenancyStyle.Conjoined) { AddPrimaryKeys(new List <TableColumn> { idColumn, mapping.Metadata.TenantId }); Indexes.Add(new IndexDefinition(mapping, TenantIdColumn.Name)); } else { AddPrimaryKey(idColumn); } AddColumn <DataColumn>(); AddIfActive(_mapping.Metadata.LastModified); AddIfActive(_mapping.Metadata.Version); AddIfActive(_mapping.Metadata.DotNetType); AddIfActive(_mapping.Metadata.CorrelationId); AddIfActive(_mapping.Metadata.CausationId); AddIfActive(_mapping.Metadata.LastModifiedBy); AddIfActive(_mapping.Metadata.Headers); foreach (var field in mapping.DuplicatedFields) { AddColumn(new DuplicatedFieldColumn(field)); } if (mapping.IsHierarchy()) { Indexes.Add(new IndexDefinition(_mapping, SchemaConstants.DocumentTypeColumn)); AddColumn(_mapping.Metadata.DocumentType); } if (mapping.DeleteStyle == DeleteStyle.SoftDelete) { AddColumn(_mapping.Metadata.IsSoftDeleted); Indexes.Add(new IndexDefinition(mapping, SchemaConstants.DeletedColumn)); AddColumn(_mapping.Metadata.SoftDeletedAt); } Indexes.AddRange(mapping.Indexes); ForeignKeys.AddRange(mapping.ForeignKeys); }
internal Index <T> AddIndexer <T, TProperty>(Expression <Func <T, TProperty> > indexer, IEqualityComparer <TProperty> comparer = default) { var property = ExpressionReflector.GetProperty(indexer); var usedComparer = comparer ?? EqualityComparer <TProperty> .Default; var indexedValues = ((IEnumerable <T>)Values).ToLookup(indexer.Compile(), usedComparer); var result = new Index <T>(property, indexedValues, usedComparer); Indexes.Add(result); return(result); }
public MyIndex(string analyzerName) { Map = customers => from customer in customers select new { Name = customer.Name }; Indexes.Add(x => x.Name, FieldIndexing.Search); Analyzers.Add(x => x.Name, analyzerName); }
public BlogPosts_ByContent() { Map = posts => from post in posts select new { Title = post.Title, Content = post.Content }; Indexes.Add(x => x.Content, FieldIndexing.Search); }
public ReceivedSmsDataByAcknowledgement() { Map = smsReceivedDatas => from receivedData in smsReceivedDatas select new { CreationDate = receivedData.SmsConfirmationData.SentAtUtc, receivedData.Acknowledge }; Indexes.Add(c => c.SmsConfirmationData.SentAtUtc, FieldIndexing.Default); Indexes.Add(c => c.Acknowledge, FieldIndexing.Default); }
public Employees_ByFirstAndLastName() { Map = employees => from employee in employees select new { LastName = employee.LastName, FirstName = employee.FirstName }; Indexes.Add(x => x.FirstName, FieldIndexing.Exact); }
public HotelRoom_Search() { Map = rooms => from room in rooms select new { //bla bla room.DndUntilUtc // add this line //bla bla }; Indexes.Add(x => x.DndUntilUtc, FieldIndexing.Analyzed); }
public Products_ByName() { Map = products => from product in products select new { product.Name }; Indexes.Add(x => x.Name, FieldIndexing.Search); // (optional) splitting name into multiple tokens Suggestion(x => x.Name); // configuring suggestions }
public Products_ByName_Search() { Map = products => from product in products select new { Name = product.Name, NameForSorting = product.Name }; Indexes.Add(x => x.Name, FieldIndexing.Search); }
public Products_ByName() { Map = products => from product in products select new { product.Name }; Indexes.Add(x => x.Name, FieldIndexing.Analyzed); Suggestion(x => x.Name); }
public CoordinatorTrackingDataByDate() { Map = coordinators => from coordinator in coordinators select new { CreationDate = coordinator.CreationDateUtc, Status = coordinator.CurrentStatus }; Indexes.Add(c => c.CreationDateUtc, FieldIndexing.Default); Indexes.Add(c => c.CurrentStatus, FieldIndexing.Default); }
/// <summary> /// Adds a computed index /// </summary> /// <param name="expressions"></param> /// <param name="configure"></param> public void Index(IReadOnlyCollection <Expression <Func <T, object> > > expressions, Action <ComputedIndex> configure = null) { var members = expressions .Select(FindMembers.Determine).ToArray(); var index = new ComputedIndex(this, members); configure?.Invoke(index); Indexes.Add(index); }
public DocumentTable(DocumentMapping mapping) : base(mapping.TableName) { // validate to ensure document has an Identity field or property mapping.CompileAndValidate(); _mapping = mapping; var idColumn = new IdColumn(mapping); AddColumn(idColumn).AsPrimaryKey(); if (mapping.TenancyStyle == TenancyStyle.Conjoined) { AddColumn(mapping.Metadata.TenantId).AsPrimaryKey(); Indexes.Add(new DocumentIndex(mapping, TenantIdColumn.Name)); } AddColumn <DataColumn>(); AddIfActive(_mapping.Metadata.LastModified); AddIfActive(_mapping.Metadata.Version); AddIfActive(_mapping.Metadata.DotNetType); AddIfActive(_mapping.Metadata.CorrelationId); AddIfActive(_mapping.Metadata.CausationId); AddIfActive(_mapping.Metadata.LastModifiedBy); AddIfActive(_mapping.Metadata.Headers); foreach (var field in mapping.DuplicatedFields.Where(x => !x.OnlyForSearching)) { AddColumn(new DuplicatedFieldColumn(field)); } if (mapping.IsHierarchy()) { Indexes.Add(new DocumentIndex(_mapping, SchemaConstants.DocumentTypeColumn)); AddColumn(_mapping.Metadata.DocumentType); } if (mapping.DeleteStyle == DeleteStyle.SoftDelete) { AddColumn(_mapping.Metadata.IsSoftDeleted); Indexes.Add(new DocumentIndex(mapping, SchemaConstants.DeletedColumn)); AddColumn(_mapping.Metadata.SoftDeletedAt); } Indexes.AddRange(mapping.Indexes); ForeignKeys.AddRange(mapping.ForeignKeys); // Compatibility with Marten rules PrimaryKeyName = $"{Identifier.Name}_pkey"; }
public Users_ByName() { Map = users => from u in users select new { Name = u.Name, LastName = u.LastName.Boost(10) }; Indexes.Add(x => x.Name, FieldIndexing.Analyzed); IndexSuggestions.Add(x => x.Name, new SuggestionOptions()); Analyzers.Add(x => x.Name, typeof(SimpleAnalyzer).FullName); Stores.Add(x => x.Name, FieldStorage.Yes); }
public BlogPosts_ByTitle() { Map = posts => from post in posts select new { Title = post.Title, Content = post.Content }; Indexes.Add(x => x.Content, FieldIndexing.No); Stores.Add(x => x.Content, FieldStorage.Yes); }
public Users_ByName() { Map = users => from u in users select new { Name = u.Name, LastName = u.LastName.Boost(10) }; Indexes.Add(x => x.Name, FieldIndexing.Search); IndexSuggestions.Add(x => x.Name); Analyzers.Add(x => x.Name, typeof(Lucene.Net.Analysis.SimpleAnalyzer).FullName); Stores.Add(x => x.Name, FieldStorage.Yes); }
public FooIndex() { Map = docs => from doc in docs select new IndexEntry { Name = doc.Name, Resolutions = doc.Resolutions }; Indexes.Add(x => x.Name, FieldIndexing.Search); Stores.Add(x => x.Resolutions, FieldStorage.Yes); }