Adding a custom MediaTypeFormatter to your WebAPI project

Adding a custom MediaTypeFormatter to your WebAPI project

This is going to be easy. As many of the other posts of this blog, even this entry is due to an issue I was forced to face, this time with the marvelous IE8 😀 In a nutshell, I have a WebAPI project returning some nice json data. Everything works...

2 minute read
How to reference an array of scripts from another script in Unity

How to reference an array of scripts from another script in Unity

Just a quick and dirty tip (actually, more of a reminder for myself), probably there’s a better way but for now it worked for me… Basically in Unity I needed a quick way to reference a list of scripts from another script. The idea is to have a “main” script...

1 minute read
Multilanguage searching with Elasticsearch

Multilanguage searching with Elasticsearch

This time I’ll start directly with the code.  First an utility method to create the connection: [csharp] private ElasticClient Connect(IEnumerable contents) { var defaultLanguageCode = “eng”; var uri = new System.Uri(ConfigurationManager.AppSettings[“ElasticSearchServer”]); var settings = new ConnectionSettings(uri).SetDefaultIndex(defaultLanguageCode); var client = new ElasticClient(settings); } [/csharp] And here’s the interesting part: [csharp] public...

1 minute read
Multilanguage indexing with Elasticsearch

Multilanguage indexing with Elasticsearch

This time I’m rambling about Elasticsearch. For those who still don’t know, Elasticsearch is a very interesting search engine based on Lucene. It’s structured to work as a NoSQL database and exposes a very nice RESTful web interface. Ok, that’s enough, let’s get started with the code! The first thing to do is...

2 minute read