コード例 #1
0
            public MyIndex_WithoutAnalyzer()
            {
                Map = customers => from customer in customers
                      select new
                {
                    Name = customer.Name
                };

                Indexes.Add(x => x.Name, FieldIndexing.Search);
            }
コード例 #2
0
    public CompaniesR_byName()
    {
        Map = companies => from company in companies
              select new
        {
            company.CompanyName
        };

        Indexes.Add(x => x.CompanyName, FieldIndexing.Analyzed);
    }
コード例 #3
0
 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");
 }
コード例 #4
0
ファイル: WorkersR.cs プロジェクト: banjac275/BanjiNetV2
    public WorkersR_byEmail()
    {
        Map = workers => from worker in workers
              select new
        {
            worker.Email
        };

        Indexes.Add(x => x.Email, FieldIndexing.Analyzed);
    }
コード例 #5
0
 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);
 }
コード例 #6
0
            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);
            }
コード例 #7
0
            public Users_ByHobbies()
            {
                Map = users => from user in users
                      select new
                {
                    user.Hobbies
                };

                Indexes.Add(x => x.Hobbies, FieldIndexing.Analyzed);
            }
コード例 #8
0
ファイル: Users_ByName.cs プロジェクト: mow/ravendb
        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);
        }
コード例 #9
0
            public Users_ByName()
            {
                Map = users => from user in users
                      select new
                {
                    user.Name
                };

                Indexes.Add(x => x.Name, FieldIndexing.Analyzed);
            }
コード例 #10
0
 protected void Init()
 {
     Indexes.Add(IdIndex);
     Indexes.Add(SubjectIndex);
     Indexes.Add(AttachmentsIndex);
     Indexes.Add(BodyIndex);
     Indexes.Add(HtmlBodyIndex);
     Indexes.Add(FromIndex);
     Indexes.Add(AccountIndex);
 }
コード例 #11
0
 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);
 }
コード例 #12
0
    public CompaniesR_byEmail()
    {
        Map = companies => from company in companies
              select new
        {
            company.Email
        };

        Indexes.Add(x => x.Email, FieldIndexing.Analyzed);
    }
コード例 #13
0
ファイル: WorkersR.cs プロジェクト: banjac275/BanjiNetV2
    public WorkersR_byLastName()
    {
        Map = workers => from worker in workers
              select new
        {
            worker.LastName
        };

        Indexes.Add(x => x.LastName, FieldIndexing.Analyzed);
    }
コード例 #14
0
        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);
        }
コード例 #15
0
        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);
        }
コード例 #16
0
            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);
            }
コード例 #17
0
            public BlogPosts_ByContent()
            {
                Map = posts => from post in posts
                      select new
                {
                    Title   = post.Title,
                    Content = post.Content
                };

                Indexes.Add(x => x.Content, FieldIndexing.Search);
            }
コード例 #18
0
 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);
 }
コード例 #19
0
            public Employees_ByFirstAndLastName()
            {
                Map = employees => from employee in employees
                      select new
                {
                    LastName  = employee.LastName,
                    FirstName = employee.FirstName
                };

                Indexes.Add(x => x.FirstName, FieldIndexing.Exact);
            }
コード例 #20
0
 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);
 }
コード例 #21
0
ファイル: Suggestions.cs プロジェクト: stjordanis/docs-1
            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
            }
コード例 #22
0
ファイル: Sorting.cs プロジェクト: ppekrol/docs
            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);
            }
コード例 #23
0
            public Products_ByName()
            {
                Map = products => from product in products
                      select new
                {
                    product.Name
                };

                Indexes.Add(x => x.Name, FieldIndexing.Analyzed);
                Suggestion(x => x.Name);
            }
コード例 #24
0
 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);
 }
コード例 #25
0
ファイル: DocumentMapping.cs プロジェクト: VilleHakli/marten
        /// <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);
        }
コード例 #26
0
ファイル: DocumentTable.cs プロジェクト: ssadevelteam/marten
        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";
        }
コード例 #27
0
ファイル: Users_ByName.cs プロジェクト: mow/ravendb
        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);
        }
コード例 #28
0
            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);
            }
コード例 #29
0
ファイル: Users_ByName.cs プロジェクト: yitaom2/ravendb
        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);
        }
コード例 #30
0
            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);
            }