问题标签 [reindex]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
performance - Magento 索引需要很长时间才能完成
我已经进口了超过 1000 万种产品,我正在尝试对其进行索引。当我尝试对其进行索引时,尤其是“目录 URL 重写、产品平面数据、目录搜索索引”需要花费大量时间。有什么方法可以对这些产品进行索引?
提前致谢。
database - Solr 异常:重新索引的未定义字段错误
希望你能帮助我。我刚开始维护的应用程序有问题。该应用程序使用 SOLR 进行索引,并且应该使用数据库中的数据填充两个核心。
重新索引时,我不断收到以下错误:
2013 年 8 月 22 日上午 10:09:49 org.apache.solr.common.SolrException 日志
严重:org.apache.solr.common.SolrException:未定义字段:“editor_id”
[... 堆栈跟踪 ...]
我的这个核心的 schema.xml:
如您所见, editor_id 存在于模式中。在数据库中,我们从表名中获取数据已重命名为 editor_user_id。当我将 editor_id 的 schema.xml 规则重命名为 editor_user_id 时,它仍然会返回上述错误,就好像 schema.xml 无关紧要一样。
我是否在这里遗漏了有关如何更新架构以匹配数据库表的内容?
任何有关如何摆脱此错误的建议都将不胜感激,因为我在 SOLR/LUCENE/TOMCAT 设置方面有点菜鸟。
谢谢。
编辑:
这是完整的堆栈跟踪:
2013 年 8 月 22 日上午 11:47:52 org.apache.solr.common.SolrException 日志严重:org.apache.solr.common.SolrException:未定义字段:org.apache.solr.schema.IndexSchema.getField 的“editor_id” (IndexSchema.java:965) 在 org.apache.solr.schema.IndexSchema.getCopyFieldsList(IndexSchema.java:1077) 在 org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:274) 在 org.apache。 solr.update.AddUpdateCommand.getLuceneDocument(AddUpdateCommand.java:73) 在 org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:201) 在 org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory. java:69) 在 org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:51) 在 org.apache.solr。update.processor.DistributedUpdateProcessor.doLocalAdd(DistributedUpdateProcessor.java:455) at org.apache.solr.update.processor.DistributedUpdateProcessor.versionAdd(DistributedUpdateProcessor.java:591) at org.apache.solr.update.processor.DistributedUpdateProcessor.processAdd( DistributedUpdateProcessor.java:350) 在 org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:100) 在 org.apache.solr.handler.loader.XMLLoader.processUpdate(XMLLoader.java:246) 在 org .apache.solr.handler.loader.XMLLoader.load(XMLLoader.java:173) 在 org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92) 在 org.apache.solr.handler.ContentStreamHandlerBase。 org.apache.solr.handler 的 handleRequestBody(ContentStreamHandlerBase.java:74)。RequestHandlerBase.handleRequest(RequestHandlerBase.java:135) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1816) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:448) at org .apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:269) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:206) 在 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 在 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 在 org.apache.catalina。 core.StandardHostValve.invoke(StandardHostValve.java:127) 在 org.apache.catalina.valves。ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org .apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) 在 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) 在 org.apache.tomcat.util.net.JIoEndpoint $Worker.run(JIoEndpoint.java:489) 在 java.lang.Thread.run(Thread.java:679)在 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:第489章)在 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:第489章)
php - 通过增加和减少所有顶部索引来重新索引数组
首先,我必须列出我发现的内容
在我的情况下,它们没有意义。我陷入了荒谬的要求,我已经强迫自己寻找出路,那么请不要问我为什么要这样做。
我有以下数组
我想将所有键增加 1 或减少 1(可接受的索引是负整数)
这是预期的结果
或者
我从raina77ow得到的 壁橱答案How to increase by 1 all keys in an array?
但它只适用于简单的数组键对,如果数组值是其他数组而不是字符串或整数,则会引发异常
我能想到的事情是手动处理数组以交换名册,如果没有任何其他解决方法,这将是最后的方法。
任何帮助表示赞赏!
php - Magento - 无法重新索引产品价格 - 外键约束失败
我最近刚刚将我的 magento 商店从 1.4.2 升级到 1.7.0.2。升级很顺利,但是当我在升级后尝试重新索引数据时。它在产品价格上失败了。
我已经尝试php shell/indexer.php --reindexall
从 SSH 使用,但它在产品价格上失败并出现这些错误(我使用 pastebin,因为错误很长):
据我所知,桌子catalog_product_index_tier_price
是空的..我不确定这是否会导致任何问题?
我尝试了许多不同的方法来解决它,但无济于事.. 比如:
- 升级到 1.6 版后无法重新索引新产品<- 我已经尝试了 Vijay Kumar 的答案
- http://www.magentocommerce.com/boards/v/viewthread/312438/#t429612 <- 我试过冲洗
/site/var/locks
- Magento:更新 1.4 -> 1.7 <- 我尝试了 Tobias Zander 的答案后,外键约束失败
他们都没有工作..我不是MySQL方面的专家,但我知道一点..所以我希望有人能够找出导致错误的原因并帮助我,我相信它也可以帮助其他人遇到和我一样的问题:)
谢谢!~
solr - Solr 完全重新索引而无需停机
我们手头有以下问题。我们希望在此过程中以 100% 的读取可用性进行完整的重新索引。从索引中删除旧文档时会出现问题。目前我们正在做某事。像这样:
这似乎可行,但对于这项任务是否有更好/更简单的解决方案?
python - Pandas:重新索引 Unsorts 数据框
我在排序然后在 Pandas 中重置我的索引时遇到了一些问题:
在我重新索引后,数据框返回未排序。我的最终目标是拥有一个索引号从 1 --> len(dfm) 排序的数据框,所以如果有更好的方法来做到这一点,我不介意,
谢谢!
java - Sybase/JDBC:如何检测重组或排他锁?
我们使用 Sybase ASE (15.5) 服务器作为我们的数据库,并且遇到了奇怪的、间歇性的 SPID 阻塞问题,我试图在应用层以编程方式检测和缓解这些问题。
Sybase 允许您安排所谓的“重组”,据我所知,这是定期重新索引/表压缩、清理等。基本上是预定的数据库维护。
每隔一段时间,我们就会让所有行星相互对齐,其中:
- 执行查询(在 Sybase 中创建 SPID)并由于某种原因挂起。这会在表上放置一个(阻塞)共享锁
widgets
;然后 - 计划的重组开始,并想要清理
widgets
表。reorg 请求排他锁widgets
,但无法获取锁,因为widgets
已被挂起的 SPID/query 锁定和阻塞;然后 - 执行后续查询,每个查询都请求共享锁
widgets
;这样 - 整个系统现在被捆绑了:reorg 在获得独占锁之前无法启动
widgets
,但widgets
被挂起的 SPID 捆绑在阻塞共享锁中。并且由于重组已在 上放置了排他锁widgets
,所有其他想要共享锁的查询widgets
都必须等到重组完成(因为新请求的排他锁胜过新请求的共享锁)。
我认为我在这里的理想策略是:
- 说,2 分钟后超时数据库查询,这将防止 SPID 挂起,从而防止重组运行;接着
- 如果查询尝试访问具有排他锁的表,请检测并特别处理它(例如安排查询在 1 小时后再次运行,希望重组完成时等)
我的问题:
- 如何让查询超时以在 2 分钟后释放共享锁?
- 有没有办法以编程方式(很可能通过 Sybase JDBC 驱动程序,但也可能通过 Sybase 命令行、HTTP 调用等)确定重组是否正在运行?或者,表上存在排他锁?这样我就可以检测到独占锁并以特殊的方式处理它。
提前致谢!
magento - Magento - 无法重新索引产品价格
强文本我试图向我的商店添加新产品,但它们没有出现。我尽我所能,但是在尝试重新索引所有数据时,产品价格产生了错误。我收到“重新索引过程出现问题”。我尝试删除 var/cache 和 var/locks(但我实际上似乎无法清空 /cache - 我不知道它是否应该是这样的)。我从 reindex 得到的输出如下:
产品价格索引过程未知错误:异常 'PDOException' 带有消息 'SQLSTATE[21S01]:插入值列表与列列表不匹配:1136 列计数与 /chroot/home/xsmokeco/xsmoke 中的第 1 行的值计数不匹配.com/html/lib/Zend/Db/Statement/Pdo.php:228 堆栈跟踪:
0 /chroot/home/xsmokeco/xsmoke.com/html/lib/Zend/Db/Statement/Pdo.php(228):PDOStatement->执行(数组)
1 /chroot/home/xsmokeco/xsmoke.com/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(数组)
2 /chroot/home/xsmokeco/xsmoke.com/html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(数组)
3 /chroot/home/xsmokeco/xsmoke.com/html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
4 /chroot/home/xsmokeco/xsmoke.com/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
5 /chroot/home/xsmokeco/xsmoke.com/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
6 /chroot/home/xsmokeco/xsmoke.com/html/app/code/local/Innoexts/StorePricing/Model/Mysql4/Downloadable/Indexer/Price.php(125): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca. ..')
7 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php(47): Innoexts_StorePricing_Model_Mysql4_Downloadable_Indexer_Price->_prepareFinalPriceData()
8 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(385): Mage_Downloadable_Model_Resource_Indexer_Price->reindexAll()
9 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexAll()
10 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Index/Model/Process.php(209): Mage_Index_Model_Indexer_Abstract->reindexAll()
11 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
12 /chroot/home/xsmokeco/xsmoke.com/html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
13 /chroot/home/xsmokeco/xsmoke.com/html/shell/indexer.php(198): Mage_Shell_Compiler->run()
14 {主要}
下一个异常“Zend_Db_Statement_Exception”和消息“SQLSTATE [21S01]:插入值列表与列列表不匹配:1136 列计数与 /chroot/home/xsmokeco/xsmoke.com/html/lib 中第 1 行的值计数不匹配” /Zend/Db/Statement/Pdo.php:234 堆栈跟踪:
0 /chroot/home/xsmokeco/xsmoke.com/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(数组)
1 /chroot/home/xsmokeco/xsmoke.com/html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(数组)
2 /chroot/home/xsmokeco/xsmoke.com/html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
3 /chroot/home/xsmokeco/xsmoke.com/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
4 /chroot/home/xsmokeco/xsmoke.com/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
5 /chroot/home/xsmokeco/xsmoke.com/html/app/code/local/Innoexts/StorePricing/Model/Mysql4/Downloadable/Indexer/Price.php(125): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca. ..')
6 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php(47): Innoexts_StorePricing_Model_Mysql4_Downloadable_Indexer_Price->_prepareFinalPriceData()
7 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(385): Mage_Downloadable_Model_Resource_Indexer_Price->reindexAll()
8 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143):Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexAll()
9 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Index/Model/Process.php(209): Mage_Index_Model_Indexer_Abstract->reindexAll()
10 /chroot/home/xsmokeco/xsmoke.com/html/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
11 /chroot/home/xsmokeco/xsmoke.com/html/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
12 /chroot/home/xsmokeco/xsmoke.com/html/shell/indexer.php(198): Mage_Shell_Compiler->run()
13 {主要}
我有点害怕更改数据库中的任何内容,因此我想在这里寻求帮助。我正在使用 magento 1.7,我从未更新过它。提前致谢
postgresql - 搜索太慢了。如何使用 pg_search gem 在 Rails 应用程序中重新索引 postgres 数据库?
我在我的应用程序中使用 pg_search gem 来实现搜索功能。在添加 pg_search 之前,我已经在我的 Postgres 数据库中的一个表中添加了 130,000 行数据。现在,当我运行搜索时,它需要的时间太长,即大约 16000 毫秒。
我正在关注 PostgreSQL 中的 Railscasts Episode343 全文搜索
这是我的 pg_search 模型中的代码:
我的服务器输出如下:
这是我用于索引的迁移文件
magento - Magento 重新索引数据 - 风险
我有一个 Magento 网站,其中似乎没有出现交叉销售产品。
在查看 Stack 和 Google 之后,似乎“重新索引数据”已经为很多人解决了这个问题。
我的问题是,执行此任务是否有任何风险?或者它是一个相对简单的程序?