symbiote-library / silverstripe-elastica Goto Github PK
View Code? Open in Web Editor NEWIntegrates SilverStripe DataObjects with Elastic Search
License: BSD 3-Clause "New" or "Revised" License
Integrates SilverStripe DataObjects with Elastic Search
License: BSD 3-Clause "New" or "Revised" License
documentation on dev tasks needs to be updated. My understanding is that Heyday-Elastica-ReindexTask
is not required and should therefore be removed. Symbiote-ElasticSearch-VersionedReindexTask
requires ?rebuild=1, ?re-index=1 or ?rebuild=1&re-index=1 to run successfully
Hi,
I added the elasticsearch functionality to the SiteTree Object. The documents are properly indexed when I save a document in Silverstripe.
But I get an error running the reindex task:
$ php framework/cli-script.php dev/tasks/SilverStripe-Elastica-ReindexTask
Running Task Elastic Search Reindex
Defining the mappings
ERROR [User Error]: Uncaught Elastica\Exception\ResponseException: ClassCastException[java.util.ArrayList cannot be cast to java.util.Map]
IN GET /dev/tasks/SilverStripe-Elastica-ReindexTask
Line 142 in /var/www/silverstripe/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php
[...]
Trace
=====
Elastica\Transport\Http->exec([...]},Array)
Request.php:166
Do you know what the problem is?
Elasticsearch-Version: 0.90.10
Thanks so much for your work on this module Andrew. I'm using it with success on one site and am about to integrate with another. One thing I'm worried about is having to put "dev-master" in my composer.json next to the package. Is there any chance you might tag a version?
The problem
When trying to save new records that are indexed by Elastic, you might get an error with something like the error below.
To avoid it currently, you need to know to run dev/tasks/Symbiote-Elastica-ReindexTask?rebuild=1
Uncaught Elastica\Exception\Bulk\ResponseException: Error in one or more bulk request actions: index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_1_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_2_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_3_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_4_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_5_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_6_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_7_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_8_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_9_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_10_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_11_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_12_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_13_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_14_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_15_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_16_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_17_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_18_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_19_Stage caused failed to parse [GlobalID] index: /my-elastic-index/MyCustomDataObject/MyCustomDataObject_20_Stage caused failed to parse [GlobalID] index: /transport-mpw-
The solution
Make the index get created during dev/build
. This means developers wont need to remember to run this and wont get an obtuse error.
Inline example:
$result = new \ArrayObject();
//
// ... set various fields ...
// ... other code ...
//
$this->owner->invokeWithExtensions('updateElasticMappings', $result);
return $result->getArrayCopy(); // return native array
Any reason this line references SolrSearchService?
Hi,
Is there a detailed instruction on how this can be setup? Could you provide one please? It seems to be useful and I don't want to write something from scratch, but I don't know how to use this one.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.