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
class ElasticSearchItemIndexerFactory { | |
private final static Logger logger = Logger.getLogger(ElasticSearchItemIndexerFactory.class) | |
public final static String NODE_TYPE = 'node' | |
public final static String TRANSPORT_TYPE = 'transport' | |
/** | |
* Crea un indexador de items para ElasticSearch | |
* @param indexerConfig mapa de configuracion generica del indexador |
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 com.rabbitmq.client.* | |
// Annotate the import is not working :S | |
@Grab(group='com.rabbitmq', module='amqp-client', version='2.7.1') | |
class Dummy {} | |
try{ | |
// Get rabbitmq config | |
def config = new ConfigSlurper().parse(new File('../rabbitmq.properties').toURL()) |
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
#Creating index with a custom analyzer | |
curl -XPUT "http://localhost:9200/myindex/" -d '{ | |
"settings" : { | |
"analysis": { | |
"analyzer": { | |
"my_analyzer": { | |
"type": "custom", | |
"tokenizer" : "standard", | |
"filter" : ["standard", "lowercase", "asciifolding"] | |
} |
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
//ORIGINAL | |
{ | |
"cluster_name" : "items", | |
"status" : "green", | |
"timed_out" : false, | |
"number_of_nodes" : 12, | |
"number_of_data_nodes" : 6, | |
"active_primary_shards" : 20, | |
"active_shards" : 40, | |
"relocating_shards" : 0, |
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
class ElasticSearchItemIndexerFactory { | |
private final static Logger logger = Logger.getLogger(ElasticSearchItemIndexerFactory.class) | |
public final static String NODE_TYPE = 'node' | |
public final static String TRANSPORT_TYPE = 'transport' | |
/** | |
* Crea un indexador de items para ElasticSearch | |
* @param indexerConfig mapa de configuracion generica del indexador | |
* @param esConfig mapa de configuracion especifica de ElasticSearch |
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
@BeforeClass | |
public static void uniqueSetUp() throws Exception { | |
startAndPopulateES() | |
System.sleep(5000) | |
} | |
private static void startAndPopulateES() { | |
def fileStream = new FileInputStream(SETTINGS_PATH) | |
Settings settings = ImmutableSettings.settingsBuilder().loadFromStream(SETTINGS_PATH, fileStream).build() |