ongr-archive / contentbundle Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED. All functionality from this bundle will not be supported by ONGR.
License: MIT License
DEPRECATED. All functionality from this bundle will not be supported by ONGR.
License: MIT License
Source: #3
Move Documents from TestingBundle to ContentBundle and setters and getters if necessary.
If no results were found this error is given
Undefined index:
ContentBundle/vendor/ongr/elasticsearch-bundle/Result/AbstractResultsIterator.php:96
ContentBundle/vendor/ongr/elasticsearch-bundle/Result/AbstractResultsIterator.php:47
ContentBundle/Service/ContentService.php:55
According to new feature in ElasticSeach bundle https://github.com/ongr-io/ElasticsearchBundle/blob/master/Resources/doc/inheritance.md
Use AbstractDocument
instead.
See https://github.com/ongr-io/ElasticsearchBundle/blob/master/Resources/doc/upgrade.md for more information
This feature could be really useful if implemented out of the box. If it takes longer to execute than expected, enhancment should be optional.
For
{{ getCategoryChildTree() }}
Last parameter fromCategory
is required (Exception "Category Id must be defined on getPartialTree() method" is thrown without it), but documentation states that it is optional.
Also it would be logical to make this parameter first as it is the defining parameter for this function.
{{ getCategoryTree() }}
Requires ONGRContentBundle:Category:inc/categorytree.html.twig
but it is not present.
Lets say we have a storage table that looks like this table:
+----+------+---------------+----------------------------------+---------------------+--------+
| id | type | document_type | document_id | timestamp | status |
+----+------+---------------+----------------------------------+---------------------+--------+
| 1 | U | product | 6b698c33118caee4ca0882c33f513d2f | 2015-01-22 15:20:25 | 0 |
| 2 | U | product | 6b6a6aedca3e438e98d51f0a5d586c0b | 2015-01-22 15:20:25 | 0 |
| 3 | C | product | id0 | 2015-01-22 15:20:25 | 0 |
| 4 | C | product | id1 | 2015-01-22 15:20:25 | 0 |
| 5 | C | product | id2 | 2015-01-22 15:20:25 | 0 |
| 6 | U | product | id0 | 2015-01-22 15:20:25 | 0 |
| 7 | U | product | id1 | 2015-01-22 15:20:25 | 0 |
| 8 | U | product | id2 | 2015-01-22 15:20:25 | 0 |
| 9 | D | product | id1 | 2015-01-22 15:20:27 | 0 |
+----+------+---------------+----------------------------------+---------------------+--------+
9 rows in set (0.01 sec)
Document id1 has three operations: CREATE (C), UPDATE (U), DELETE (D). In original table this document doesn't exists, but Sync/StorageManager/MysqlStorageManager::addRecord()
method tries to access this document and sets $this->currentEntity
to null. Then SyncStorageImportIterator::next()
goes to second IF statement and the status of $this->currentEntity
becomes $this->valid = false
and Pipeline stops working.
Final status of storage table becomes:
+----+------+---------------+----------------------------------+---------------------+--------+
| id | type | document_type | document_id | timestamp | status |
+----+------+---------------+----------------------------------+---------------------+--------+
| 4 | C | product | id1 | 2015-01-22 15:20:25 | 1 |
| 5 | C | product | id2 | 2015-01-22 15:20:25 | 0 |
| 6 | U | product | id0 | 2015-01-22 15:20:25 | 0 |
| 7 | U | product | id1 | 2015-01-22 15:20:25 | 0 |
| 8 | U | product | id2 | 2015-01-22 15:20:25 | 0 |
| 9 | D | product | id1 | 2015-01-22 15:20:27 | 0 |
+----+------+---------------+----------------------------------+---------------------+--------+
Sync storage should simplify operations for id1 document and leave only DELETE (D) operation (for removing from ES).
UrlObject must implement getKey and setKey, as in ongr/router-bundle.
In this document, there is ParentId field, it shouldn't be here, DocumentInterface already has Parent field
Currently buildQuery method could not be overridden in a clean way if we would want to use properties from parent.
const ROOT_CATEGORY_ID = 'category_rood_id'; - it doesn't work. Should be moved to config. Workaround is change value to 'oxrootid'.
method buildQuery()
$search->addQuery(new TermQuery('is_active', true), 'must');
should be $search->addQuery(new TermQuery('active', true), 'must');
In CategoryTrait needs to change:
from * @es\Property(type="boolean", name="is_active")
to * @es\Property(type="boolean", name="active")
ContentBundle dependency ongr/router-bundle is added to require dev through composer, but must be in required.
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.