ravendb

How do I construct my RavenDb static indexes for this document, given these requirements?

女生的网名这么多〃 提交于 2019-12-22 11:17:21
问题 I have close to 3 million documents that are being stored in a RavenDb embedded instance. Everyone of the fields will be subjected to some type of filter/query/sorting, but in particular I wanted to do some type of intelligent textual search of the info and info2 columns. How might I go about constructing the RavenDb Indexes? My first pass at the info2 column looks like this. store.DatabaseCommands.PutIndex("ProdcustByInfo2", new IndexDefinitionBuilder<Product> { Map = products => from

Ninject problem binding to constant value in MVC3 with a RavenDB session

柔情痞子 提交于 2019-12-22 10:56:11
问题 I've seen a lot of different ways of configuring Ninject with ASP.NET MVC, but the implementation seems to change slightly with each release of the MVC framework. I'm trying to inject a RavenDB session into my repository. Here is what I have that's almost working. public class MvcApplication : NinjectHttpApplication { ... protected override void OnApplicationStarted() { base.OnApplicationStarted(); AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters);

Substring with spacebar search in RavenDB

倖福魔咒の 提交于 2019-12-22 10:54:01
问题 I'm using such a query: var query = "*" + QueryParser.Escape(input) + "*"; session.Query<User, UsersByEmailAndName>().Where(x => x.Email.In(query) || x.DisplayName.In(query)); With the support of a simple index: public UsersByEmailAndName() { Map = users => from user in users select new { user.Email, user.DisplayName, }; } Here I've read that: "By default, RavenDB uses a custom analyzer called LowerCaseKeywordAnalyzer for all content. (...) The default values for each field are FieldStorage

RavenDB: How can I prevent high RAM utilization?

五迷三道 提交于 2019-12-22 10:46:50
问题 My application includes a few queries which return large result sets (although I've capped it with a Take(300) lambda. During peak usage times, I've seen Raven.Server.exe consume an unusually large amount of RAM. In fact, during these times, Raven.Server.exe can exhaust my server's available RAM. How can I avoid this situation? After a few Google searches, I can see that other people have encountered this error before me. But RavenDB has evolved during the past few years and there are many

RavenDB Query Suggest Multiple Words

为君一笑 提交于 2019-12-22 10:38:16
问题 I have some code that is searching a RavenDB database with the following index: public class Products_Search : AbstractIndexCreationTask<Product, Products_Search.Result> { public class Result { public string Query { get; set; } } public Products_Search() { Map = products => from product in products select new { Query = new { Categories = product.Categories.Boost(5), Brands = product.Brands.Boost(8), product.Description, Name = product.Name.Boost(10), product.SKU }, product.Price }; Index(x =>

Order by ID in RavenDB

心不动则不痛 提交于 2019-12-22 08:55:26
问题 Is there a way to have Raven order the results of a query by the Id field as if it was in integer. So "cars/2" would come before "cars/11" if I did this query: var cars = session.Query<Car>().OrderBy(c => c.ID); 回答1: You shouldn't rely on the id of the document to be sortable in any way. Add a CreatedAt property or something similar and use that 来源: https://stackoverflow.com/questions/6144898/order-by-id-in-ravendb

Query product catalog RavenDB store for spec aggregate over arbitrary collection of products

余生颓废 提交于 2019-12-22 07:05:09
问题 This is a continuation of the project outlined in this question. I have the following model: class Product { public string Id { get; set; } public string[] Specs { get; set; } public int CategoryId { get; set; } } The "Specs" array stores product specification name value pairs joined by a special character. For example if a product is colored blue the spec string would be "Color~Blue". Representing specs in this way allows querying for products having multiple spec values specified by a query

Managing RavenDB IDocumentSession lifecycles with StructureMap for NServiceBus and MVC

拈花ヽ惹草 提交于 2019-12-22 06:49:28
问题 I am using NServiceBus v4.3, MVC4, RavenDB 2.5 and StructureMap 2.6.4 in our solution. I am having a similar issue under StructureMap to that described in this question's responses where I require different lifecycles for the MVC Controller and NServiceBus Handler use of RavenDB's IDocumentSession in my Web project. Specifically in my case what happens is that if I use the HybridHttpOrThreadLocalScoped (as the above answer suggests for Windsor) lifecycle the sessions are not properly disposed

Workaround for selectmany in ravendb using client api

对着背影说爱祢 提交于 2019-12-22 06:38:04
问题 I have a ravendb class like such: public class Student { public string Id { get; set; } public string TopLevelProperty { get; set; } public Dictionary&ltstring, string&gt Attributes { get; set; } public Dictionary&ltstring,List&ltDictionary&ltstring, string&gt&gt&gt CategoryAttributes { get; set; } } and a document like so: The following linq will not work due to a selectmany: test = (from student in session.Query() from eduhistory in student.CategoryAttributes["EducationHistory"] where

RavenDB Errors with NServiceBus 4.0

安稳与你 提交于 2019-12-22 05:33:28
问题 I've downloaded and installed NServiceBus 4.0, but I'm having some difficulty when the bus starts up... 2013-09-18 15:53:40,887 [1] WARN NServiceBus.Persistence.Raven.RavenUserInstall er [(null)] <(null)> - Failed to add user to raven. Processing will continue System.MissingMethodException: Method not found: 'Raven.Abstractions.Data.PutRes ult Raven.Client.Connection.IDatabaseCommands.Put(System.String, System.Nullable `1, Raven.Json.Linq.RavenJObject, Raven.Json.Linq.RavenJObject)'. at