<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Search Nuggets &#187; Mats Julian Olsen</title>
	<atom:link href="http://blog.comperiosearch.com/blog/author/molsen/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.comperiosearch.com</link>
	<description>A blog about Search as THE solution</description>
	<lastBuildDate>Mon, 13 Jun 2016 08:59:45 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>Crafting elasticsearch queries in Python.</title>
		<link>http://blog.comperiosearch.com/blog/2014/12/17/crafting-elasticsearch-queries-python-hassle-free-way/</link>
		<comments>http://blog.comperiosearch.com/blog/2014/12/17/crafting-elasticsearch-queries-python-hassle-free-way/#comments</comments>
		<pubDate>Wed, 17 Dec 2014 12:36:39 +0000</pubDate>
		<dc:creator><![CDATA[Mats Julian Olsen]]></dc:creator>
				<category><![CDATA[Elasticsearch]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.comperiosearch.com/?p=3120</guid>
		<description><![CDATA[Creating JSON-like structures in Python (or any other programming language), can be a cumbersome experience. Consider this snippet from the elasticsearch-py library, taken from the example/query.py file: I would argue that 33 lines for creating the facets above is too much. To save you from the dreaded hassle of writing JSON in your programs, I [...]]]></description>
				<content:encoded><![CDATA[<p>Creating JSON-like structures in Python (or any other programming language), can be a cumbersome experience. Consider this snippet from the <a title="elasticsearch-py" href="https://github.com/elasticsearch/elasticsearch-py">elasticsearch-py</a> library, taken from the <a href="https://github.com/elasticsearch/elasticsearch-py/blob/master/example/queries.py">example/query.py </a>file:</p>
<script src="https://gist.github.com/6a30b86a010f361b9256.js"></script>
<p>I would argue that 33 lines for creating the facets above is too much.</p>
<p>To save you from the dreaded hassle of writing JSON in your programs, I created <a href="https://github.com/mewwts/addict"><em>addict,</em></a> a Python dictionary that let&#8217;s you create nested dictionaries using get- and set attribute syntax.</p>
<p>Here&#8217;s how the same code looks with addict<em>:</em></p>
<script src="https://gist.github.com/49e0fdf5bff3aeda521a.js"></script>
<p><a href="https://github.com/mewwts/addict"><em>addict</em></a> is open-source and MIT-licensed. It is actively developed and anyone interested is encouraged to submit issues and pull requests, as both are more than welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2014/12/17/crafting-elasticsearch-queries-python-hassle-free-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
