mapping

How to make elasticsearch add the timestamp field to every document in all indices?

北城余情 提交于 2019-12-31 08:34:13
问题 Elasticsearch experts, I have been unable to find a simple way to just tell ElasticSearch to insert the _timestamp field for all the documents that are added in all the indices (and all document types). I see an example for specific types: http://www.elasticsearch.org/guide/reference/mapping/timestamp-field/ and also see an example for all indices for a specific type (using _all): http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping/ but I am unable to find any

Render custom tiles in R leaflet from local directory (i.e. not from a git repository)

不羁岁月 提交于 2019-12-31 03:18:05
问题 I have created some tiles out of a very large raster using the Qtiles plugin in Qgis. I have saved them to a local directory on my computer, and now want to render them in a leaflet map using R. The addTiles function passes a URL, but doesn't seem to work with a local filepath. In a different post (How to render custom map tiles created with gdal2tiles in Leaflet for R?), Lauren recommends using a www folder inside the shiny directory. Firstly, I'm not 100% sure what is meant by that, and

How to pass constructor's parameters with jackson?

独自空忆成欢 提交于 2019-12-30 11:33:28
问题 i am trying to desearlize an object using Jackson this.prepareCustomMapper().readValue(response.getBody(), EmailResponse.class); and i have this exception: org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class com.despegar.social.automation.services.emailservice.response.EmailResponse]: can not instantiate from JSON object (need to add/enable type information?) at [Source: java.io.StringReader@4f38f663; line: 1, column: 12] (through

Spring: DispatcherServlet and static content

旧街凉风 提交于 2019-12-30 10:57:20
问题 In my Spring web-app i have mapped /app/* to dispatcher servlet. What is the best approach in that scenerio to separate a static content like images , .js , .css from dispatcher ? <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/app/*</url-pattern> </servlet-mapping> For example, when i open url: http://server/context/app/users and on users.jsp have <img src="images/test.png"/> i get no image because http://server/conext/app/users/images/test.png is not a right url. Now

nhibernate query all objects implementing an interface

大兔子大兔子 提交于 2019-12-30 10:34:56
问题 For example, if you have an Apple : IWhatever, and an Orange : IWhatever and you want to find both of them because they are IWhatevers, what do you need to do in NHibernate? Is it completely dependent on the HQL or criteria query, or is there something you must do in the mapping also? If there is a mapping requirement, can Fluent NHibernatee support it? 回答1: You could do a UnionSubClass mapping. Unforntunately it is unsuported in Fluent. You mapping would be something like: <class name=

nhibernate query all objects implementing an interface

最后都变了- 提交于 2019-12-30 10:34:19
问题 For example, if you have an Apple : IWhatever, and an Orange : IWhatever and you want to find both of them because they are IWhatevers, what do you need to do in NHibernate? Is it completely dependent on the HQL or criteria query, or is there something you must do in the mapping also? If there is a mapping requirement, can Fluent NHibernatee support it? 回答1: You could do a UnionSubClass mapping. Unforntunately it is unsuported in Fluent. You mapping would be something like: <class name=

EF4 Code First - How to properly map Splitting an Entity Across Multiple Tables

帅比萌擦擦* 提交于 2019-12-30 09:39:15
问题 I am using EF4 CTP5 to try to persist a POCO object that is split among two tables, the link being the ContactID. When i save a contact, i want the core contact information saved in one table (Contacts), and the link to the user who owns the contact saved in another (UserToContacts). I have the custom mapping defined below, but when I SaveChanges, i get the following error: A value shared across entities or associations is generated in more than one location. Check that mapping does not split

NHibernate mappings issue when referencing class (lazy load issue?)

柔情痞子 提交于 2019-12-30 06:57:39
问题 I'm using NHibernate + Fluent to handle my database, and I've got a problem querying for data which references other data. My simple question is: Do I need to define some "BelongsTo" etc in the mappings, or is it sufficient to define references on one side (see mapping sample below)? If so - how? If not please keep reading.. Have a look at this simplified example - starting with two model classes: public class Foo { private IList<Bar> _bars = new List<Bar>(); public int Id { get; set; }

NHibernate mappings issue when referencing class (lazy load issue?)

此生再无相见时 提交于 2019-12-30 06:57:07
问题 I'm using NHibernate + Fluent to handle my database, and I've got a problem querying for data which references other data. My simple question is: Do I need to define some "BelongsTo" etc in the mappings, or is it sufficient to define references on one side (see mapping sample below)? If so - how? If not please keep reading.. Have a look at this simplified example - starting with two model classes: public class Foo { private IList<Bar> _bars = new List<Bar>(); public int Id { get; set; }

OneToMany - what are the differences between join table and foreign key?

£可爱£侵袭症+ 提交于 2019-12-30 04:29:04
问题 There is the possibility to disable the @OneToMany relationship join table with the @JoinColumn annotation. The default is a join table. What are the advantages and disadvantages for a production system for example? When should I use a join table and when not? Thank you. 回答1: By default @OneToMany will create a join table only if you'll use unidirectional relationship . In other words, if you have Employee and Project entities and the Employee entity is defined as follows (assume there is no