Comments (9)
+1
from mongogento.
Because Attributes can come from both mysql and mongodb - you would want to load from both and merge otherwise you will not load all attributes! That is my understanding from using this extension!
from mongogento.
ok thanks for your reply
we are saving all attributes of product in mongo-db is am right?
that why i am saying that we did not need to load attributes from mysql
from mongogento.
public function getSqlAttributesCodes()
{
if (is_null($this->_sqlAttributeCodes)) {
$this->_sqlAttributeCodes = array();
$specialAttributes = array(
'visibility', 'status', 'price', 'tax_class_id', 'name', 'url_key', 'url_path',
'special_price', 'special_from_date', 'special_to_date', 'msrp', 'price_type'
);
$staticFields = $this->_getWriteAdapter()->describeTable($this->getEntityTable());
$this->_sqlAttributeCodes = array_merge($specialAttributes, array_keys($staticFields));
}
return $this->_sqlAttributeCodes;
}
These Attributes are never stored in mongodb!
from mongogento.
If we are still querying the the MYSQL for Attributes would it not kill purpose of using MongoDB? After all that's the whole purpose of using it and avoid querying EAV tables which in this case we are not, in fact it will slow down further, because we will be querying both EAV and now an additional request is sent to Mongo. The attributes you mentioned are already in Mongo.
from mongogento.
Hi Southerncomputer,
If you import data from mysql to mongo db using shell script, you will see all these attributes stored in mongo-db
public function getSqlAttributesCodes() { if (is_null($this->_sqlAttributeCodes)) { $this->_sqlAttributeCodes = array(); $specialAttributes = array( 'visibility', 'status', 'price', 'tax_class_id', 'name', 'url_key', 'url_path', 'special_price', 'special_from_date', 'special_to_date', 'msrp', 'price_type' ); $staticFields = $this->_getWriteAdapter()->describeTable($this->getEntityTable()); $this->_sqlAttributeCodes = array_merge($specialAttributes, array_keys($staticFields)); } return $this->_sqlAttributeCodes; }
will you checked and confirm
from mongogento.
Hello everybody. @southerncomputer is right, there is some attributes that are kept into MySQL. These attributes are used when rebuilding Magento indexes, so we make them stay in MySQL to avoid having to rewrite all indexes processes. If you remove this data from MySQL, there won't be any index process running properly on your website, so the site may be broken.
Concerning the fact that we are loading these attributes from MySQL when loading a collection, I agree that it may does nothing.
Let's take a look at this : https://github.com/Smile-SA/mongogento/blob/master/src/app/code/community/Smile/MongoCatalog/Model/Resource/Override/Catalog/Product/Collection.php#L461
addAttributeToSelect
is dismantled since we do not care about adding attributes to select one by one (we fetch a full mongo document everytime).
This would mean that when reaching this piece of code : http://doc4dev.net/doc/Magento/1/source-class-Mage_Eav_Model_Entity_Collection_Abstract.html#1076
The variable _selectAttributes
should alway be empty : so we never build the query to load data from MySQL.
Feel free to test without the parent calls to _loadAttributes and let me know.
Regards
from mongogento.
I tested without the parent calls to _loadAttributes and it worked fined for me
from mongogento.
Perhaps it was legacy before the attribute migration tool that existed - so you could load attributes from mysql and save them to mongodb!
I remember that being the case before the migration tool existed you had to load each product from mysql and save() it to move the attributes to mongodb.
from mongogento.
Related Issues (19)
- {__FILE__} notnull : unsuported MongoDB attribute filter HOT 3
- Can't canonicalize query: BadValue $in needs an array HOT 2
- Populate monogdb HOT 4
- Does MongoGento Work on Magento Community Edition? HOT 9
- Configure Mongo to Magento
- category_ids is not supported since magento 1.4 HOT 2
- MongoGento Work on Magento Community Edition? HOT 4
- using mongodb connection in the application.
- mongo deprecated in favor of mongoDB HOT 3
- Still in development? HOT 3
- is it support Flat Table HOT 2
- addAttributeToFilter()
- Could not convert BSON document to a PHP variable
- Mongogento en Windows
- how db connection picking from mongogento.xml file? HOT 1
- Fatal error: MongoInt32 class not found HOT 2
- Magento support version HOT 1
- exception 'BadMethodCallException' with message 'Call to a member function addData()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongogento.