Handling Tabulated data

CSV Files are organized in rows and columns using a CSV delimiter. A data field have a row index and column index, generally described in a String format while it can represent a Date, a Number or other content. Elastic Search handles CSV parsing, reconstruction and data content interpretation via a set of options. In this part we will show how Elastic Search meets needs for CSV content management and interpretation.

Elastic Search provides a set of properties enabling an advanced CSV data input parsing and analysis. These properties and methods are following:

It is advised to visit the Data Support in Elastic Search for greater understanding.

The following tabulated data refers to a potential CSV input of Elastic Search. This data source will be used later in the code sample provided later.

Name;Country;Language;Continent
Jodie;Belgique;French;Europe
Kate;Australia;English;Asia Pacific
David;USA;English;Europe
Nicolas;Russia;Russian;Europe
Michael;USA;English;Europe
Isabelle;France;French;Europe
Dudek;Russia;Russian;Europe
Hilary;USA;English;Europe
Georges;Finland;English;Europe
Fani;Italia;Italian;Europe
Bertrand;France;French;Europe
Cyril;France;French;Europe
Fran├žois;Belgique;French;Europe
Slim;Tunisia;Arabic;Africa
Patrick;France;French;Europe
Abdu;Nigeria;Nigerian;Africa
This tabulated input will be consummed by the Elastci Search component in the following example. The component will be configured to be capable of parsing this input according to our search needs.
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:elasticsearch="fr.kapit.elasticsearch.*" xmlns:kapit="fr.kapit.*" preinitialize="onPreinitialize()">
	<mx:Script>
		<![CDATA[
			[Embed(source="data.csv",mimeType="application/octet-stream")]
			private var csvSource:Class;
			[Bindable]
			private var _dataProvider:String;
			private function onPreinitialize():void
			{
				var byteArray:ByteArray=new csvSource() as ByteArray;
				var content:String=byteArray.readUTFBytes(byteArray.length);
				_dataProvider=new String(content);
			}
		]]>
	</mx:Script>
	<mx:VBox width="100%">	
		<elasticsearch:ElasticSearch
		height="270"
		width="100%"
		filterProperties="{['Continent','Country','Language','Name']}"
		idColumnHeader="Name"
		dataProvider="{_dataProvider}"
		/>
	</mx:VBox>
</mx:Application>