git bisect can turn out to be very useful when you want to find a bug in a series of commits. It uses binary search to search through commits and helps you find out where a bug was introduced. Lets take a look at an example. Say you have a file called controller.py, and you […]

Writing unit/integration tests for your search code ? If this includes creating an index and adding some data for your tests, the wait_for_status flag might be useful. The API looks like this: http://localhost:9200/health?wait_for_status=green&timeout=50s This is a blocking call and will wait till the timeout provided till the status changes. This will definitely be more helpful than sleeping […]

There is typing I do on my PyCharm which are repetitive. An example of this is adding a breakpoint. I use ipdb to debug and I always need to type in this when I need to add a breakpoint: from ipdb import set_trace; set_trace() To avoid this, you can always use PyCharm’s macros to record the typing and […]

Navigating though code in PyCharm is easy. All you would need is this: But there is a hidden open-everything shortcut which might just save your day. Hit shift twice and this is what you’ll see: This window shows you classes, files and symbols. Its a lot easier than using a shortcut for each type !

You can close an active index in Elasticsearch. Deleting an index removes the entire index and you can never recover it. Closing an index, on the other hand, lets you revive the index on-demand. Closing an index removes the index from memory, but saves it into disk. The cluster overhead it incurs is pretty minimal as […]

The _source field is an predefined field which ES (elasticsearch) manages. It contains the entire document, just as it was sent for indexing. Here is an example of what you get back when you search on ES: As you see here, the default behavior (where _source is enabled) is that ES gives you back the […]