This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An Unobtrusive Javascript (UJS) driver based on explicit behavior definitions. Just | |
// put a "data-behaviors" attribute on your view elements, and then assign callbacks | |
// for those named behaviors via Behaviors.add. | |
$.behaviors = { | |
add: function(trigger, behavior, handler) { | |
$('[data-behaviors~=' + behavior + ']').each(function() { | |
$(this).bind(trigger, handler); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jQuery selectbox plugin | |
* | |
* Copyright (c) 2007 Sadri Sahraoui (brainfault.com) | |
* Licensed under the GPL license and MIT: | |
* http://www.opensource.org/licenses/GPL-license.php | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
* The code is inspired from Autocomplete plugin (http://www.dyve.net/jquery/?autocomplete) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import pyes | |
>>> conn = pyes.es.ES("localhost:9200") | |
>>> search = pyes.query.MatchAllQuery().search(bulk_read=1000) | |
>>> hits = conn.search(search, 'index', 'type', scan=True, scroll="30m", model=lambda _,hit: hit) | |
>>> for hit in hits | |
... conn.index(hit['_source'], 'new_index', 'type', hit['_id'], bulk=True) | |
... | |
>>> conn.flush() |