Skip to content

Instantly share code, notes, and snippets.

View ofavre's full-sized avatar

Olivier Favre ofavre

  • WonderPush
  • Paris, France
View GitHub Profile
[2011-07-28 10:47:08,638][DEBUG][action.index ] [Adaptoid] [index][0], node[h04seeuQQAuniYzZszGDVA], [P], s[STARTED]: Failed to execute [index {[index][type][9223372036854775807], source[{"integer":9223372036854775807}]}]
org.elasticsearch.index.mapper.MapperParsingException: Failed to parse [integer]
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:309)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeValue(ObjectMapper.java:565)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:440)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:561)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:490)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:289)
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:185)
at
@ofavre
ofavre / recreation.sh
Created July 15, 2011 13:55
ElasticSearch Scroll API (documentation) bug
set -v
curl -XDELETE 'localhost:9200/index'
curl -XPUT 'localhost:9200/index' -d '{"settings":{"index":{"number_of_shards":4,"number_of_replicas":0}}}'
curl -XPUT 'localhost:9200/index/type/_mapping' -d '{
"type":{
@ofavre
ofavre / recreation.sh
Created July 5, 2011 12:29
Highlight not working for multi-fields if each subfield is not stored, "main subfield" stored, and _source disabled
set -v
# Delete an eventual previous index
curl -XDELETE 'localhost:9200/bugindex'
# Create an index
curl -XPUT 'localhost:9200/bugindex' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
@ofavre
ofavre / recreation.sh
Created June 23, 2011 12:56
include_in_all ignored for multi_fields
curl -XDELETE 'localhost:9200/index'
{"ok":true,"acknowledged":true}
curl -XPUT 'localhost:9200/index' -d '{"settings":{"index":{"number_of_shards":1,"number_of_replicas":0}}}'
{"ok":true,"acknowledged":true}
# The mapping I would like
curl -XPUT 'localhost:9200/index/type/_mapping' -d '{
"type":{
"_source":{ "enabled":false },
"_all":{ "enabled":true },
"properties":{
@ofavre
ofavre / highlight.sh
Created June 23, 2011 09:42
Problem in highlighting with stemming analyzers using most default parameters
curl -XDELETE 'localhost:9200/index'
{"ok":true,"acknowledged":true}
curl -XPUT 'localhost:9200/index' -d '{"settings":{"index":{"number_of_shards":1,"number_of_replicas":0}}}'
{"ok":true,"acknowledged":true}
# The mapping I would like
curl -XPUT 'localhost:9200/index/type/_mapping' -d '{
"type":{
"_source":{ "enabled":false },
"_analyzer":{ "path":"lang" },
"properties":{
@ofavre
ofavre / gist:1000701
Created May 31, 2011 15:37
Using boolean queries and fields in ElasticSearch 0.16.1
curl -XDELETE 'http://127.0.0.1:9202/test/bool'
{"ok":true}
curl -XPUT 'http://127.0.0.1:9202/test/bool/_mapping' -d '{"bool":{"properties":{"bool":{"type":"boolean"}}}}'
{"ok":true,"acknowledged":true}
curl -XGET 'http://127.0.0.1:9202/test/bool/_mapping'
{"bool":{"properties":{"bool":{"type":"boolean"}}}}
curl -XPOST 'http://127.0.0.1:9202/test/bool' -d '{"bool":"yes"}'
{"ok":true,"_index":"test","_type":"bool","_id":"mC0iSbDGRi6ypBBUBOpe0Q","_version":1}
curl -XPOST 'http://127.0.0.1:9202/test/bool' -d '{"bool":"T"}'
{"ok":true,"_index":"test","_type":"bool","_id":"EUMdXikfQ0apBcS4tIFPFA","_version":1}
@ofavre
ofavre / gist:998638
Created May 30, 2011 09:15
Testing performance for constant score queries in ElasticSearch 0.16.1

Purpose

I need to perform special ranking based on some criteria.
Before playing with my precise need, I’ve tested different possibilities, namely:

  • Using built-in queries
  • Using custom script in mvel (the fastest scripting facility according to ES documentation)
  • Using a native script plugin written in Java

I present here the results of the comparative performance test