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
curl -XDELETE "http://localhost:9200/geo_polygon" | |
curl -XPOST "http://localhost:9200/geo_polygon" | |
# We index points with geo_point and geo_shape types for testing purpose | |
curl -XPOST "http://localhost:9200/geo_polygon/loc/_mapping" -d' | |
{ | |
"loc": { | |
"properties": { |
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
# Delete index | |
curl -XDELETE "http://localhost:9200/test_geojson" | |
# Create a test index | |
curl -XPOST "http://localhost:9200/test_geojson" | |
# Put mapping | |
curl -XPOST "http://localhost:9200/test_geojson/geo/_mapping" -d' | |
{ | |
"geo": { |
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
@SuppressWarnings({"unchecked"}) | |
@Nullable | |
public Object readGenericValue() throws IOException { | |
byte type = readByte(); | |
switch (type) { | |
case -1: | |
return null; | |
case 0: | |
return readString(); | |
case 1: |
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
org.elasticsearch.script.groovy.GroovyScriptExecutionException: BufferOverflowException[null] | |
at org.elasticsearch.script.groovy.GroovyScriptEngineService$GroovyScript.run(GroovyScriptEngineService.java:278) | |
at org.elasticsearch.search.fetch.script.ScriptFieldsFetchSubPhase.hitExecute(ScriptFieldsFetchSubPhase.java:74) | |
at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:194) | |
at org.elasticsearch.search.SearchService.executeScan(SearchService.java:276) | |
at org.elasticsearch.search.action.SearchServiceTransportAction$21.call(SearchServiceTransportAction.java:520) | |
at org.elasticsearch.search.action.SearchServiceTransportAction$21.call(SearchServiceTransportAction.java:517) | |
at org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559) | |
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) | |
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) |
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
from __future__ import absolute_import | |
from celery import Celery | |
# This file must be put in a subdirectory proj | |
app = Celery('tasks', broker='redis://localhost', backend='redis://localhost', include=['proj.tasks']) | |
app.conf.update( | |
CELERY_TASK_SERIALIZER='json', | |
CELERY_ACCEPT_CONTENT=['json'], # Ignore other content |
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
package com.opendatasoft.elasticsearch.index.mapper.geo; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.document.FieldType; | |
import org.elasticsearch.common.Strings; | |
import org.elasticsearch.common.geo.GeoPoint; | |
import org.elasticsearch.common.settings.ImmutableSettings; | |
import org.elasticsearch.common.xcontent.XContentBuilder; | |
import org.elasticsearch.index.fielddata.FieldDataType; | |
import org.elasticsearch.index.mapper.*; |
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
DELETE test_point | |
PUT test_point | |
{ | |
"mappings": { | |
"point": { | |
"properties": { | |
"point": { | |
"type": "geo_point" | |
} |