首页 \ 问答 \ Solr拼写检查配置(Solr spellcheck configuration)

Solr拼写检查配置(Solr spellcheck configuration)

我正在尝试使用IndexBasedSpellChecker构建拼写检查索引

<lst name="spellchecker">
  <str name="name">default</str>
  <str name="field">text</str>
  <str name="spellcheckIndexDir">./spellchecker</str>
</lst>

我想指定动态字段“* _text”作为字段选项:

<dynamicField name="*_text" stored="false" type="text" multiValued="true" indexed="true">

怎么做?


I am trying to build the spellcheck index with IndexBasedSpellChecker

<lst name="spellchecker">
  <str name="name">default</str>
  <str name="field">text</str>
  <str name="spellcheckIndexDir">./spellchecker</str>
</lst>

And I want to specify the dynamic field "*_text" as the field option:

<dynamicField name="*_text" stored="false" type="text" multiValued="true" indexed="true">

How it can be done?


原文:https://stackoverflow.com/questions/3004823
更新时间:2023-07-21 19:07

最满意答案

一些东西:

首先,如果要访问超过一半的数据块,则完全扫描会更快,因为读取索引块是另一个IO调用,因此读取索引行的时间通常是读取连续行的两倍。

其次,无论是否有索引,您都需要查看您的计划。 这里将提供信息,让您知道改变了什么。 如果你看到“Merge Join Cartesian”,那么规划师就会出错。 那个计划永远不会好。 完全扫描的内部循环具有相同的IO成本,但占用的内存和临时空间更少。

第三,你使用ANALYZE TABLE构建了统计数据。 别。 甚至甲骨文也表示它很糟糕而且很糟糕。 使用dbms_stats包来构建统计数据,您将获得更准确的统计数据。 如果它仍然是奇数,请更改样本大小,或执行完整统计而不是估计。


A few things:

First, if you are accessing over half of the data blocks, full scan will be faster because reading the index block is another IO call, so the read of an indexed row is generally twice as expensive time wise as reading a sequential row.

Second, you need to look at your plans with and without the index. There will be information here that will let you know what changed. If you see a "Merge Join Cartesian" the planner has made an error. That plan is NEVER good. Inner loops of full scans have the same IO cost, but take less memory and temp space.

Third, you built stats with ANALYZE TABLE. Don't. Even Oracle says it is bad and broken. Use the dbms_stats package to build your stats, and you will get more accurate stats. If it is still odd, change your sample size, or do full stats instead of estimated.

相关问答

更多
  • 尝试创建索引,如下所示,然后查看EXPLAIN计划 CREATE INDEX idx_order_date_user_id ON carts_archive(order_date,user_id); Try creating index as below and then see EXPLAIN plan CREATE INDEX idx_order_date_user_id ON carts_archive(order_date,user_id);
  • 在分析索引时很难说DTA是错误的,因为我不知道数据分布,但确实如此,但我在主键之外添加的第一个索引是SHOP.CityID上的(可能是复合的)索引。 SHOP.Active 。 没有测试,我不能给你任何绝对,但这是推理。 由于您基本上是在SHOP上进行过滤并且在任何其他表上都没有过滤器,因此查询的大量提升很可能是在SHOP过滤50M行。 如果数据库开始从任何其他表加入,则未过滤的连接将导致针对CITY 3M行,并且从过滤SHOP开始将极有可能导致更少的数量。 有充分理由,编译器喜欢“更少”。 这是SHOP上 ...
  • 如果您始终按tag搜索,则只需索引tag列。 在未使用时将列添加到索引,在插入或更新记录时会引入不必要的开销,并且还会占用更多存储空间。 但是复合索引( tag , site )可能会提供额外的优化,因为MySQL只需要读取索引来满足您的查询( EXPLAIN通常将此优化标记为using index )。 如果您的操作主要是读取而不是写入,那么使用复合索引可能不是一个坏主意。 如果tag列具有高基数会更好,这意味着它们的值很可能在每行之间不同。 但我建议你先咨询EXPLAIN输出。 If you alway ...
  • 尝试为字段“batch_no”创建索引,因为查询正在此字段中进行搜索。 PS:使用desc索引,因为搜索是最大值 try to create an index for the field "batch_no", because the query is doing a search in this field. PS : Use a desc index, because the search is for the max value
  • 我期望以下多列索引是最快的: CREATE INDEX orders_foo_idx ON orders (total DESC, client_id); PostgreSQL 9.2可能会受益匪浅。 由于它是“仅索引元组”功能,它可以在有利的情况下为查询提供查询而不会碰到表格:自上次VACUUM以来没有写入。 在这种情况下, DESC或ASC几乎不重要。 B树索引可以在两个方向上搜索几乎同样有效。 I would expect the following multicolumn index to be ...
  • 在企业版中,您可以进行在线索引操作。 它看起来像这样: create index MyIDX on MyTable (MyColumn) with (online = on) 请注意,该操作在该过程中(在开始和结束时,IIRC)仍然会进行一些锁定,但在索引创建期间不锁定该表。 如果您担心,请在非生产环境中启动扩展事件会话,并跟踪创建索引时创建的锁和创建多久的锁。 更新: 文档中有关于在线和离线操作时都保持什么锁的相当好的说明。 In Enterprise Edition, you gain the abi ...
  • 一些东西: 首先,如果要访问超过一半的数据块,则完全扫描会更快,因为读取索引块是另一个IO调用,因此读取索引行的时间通常是读取连续行的两倍。 其次,无论是否有索引,您都需要查看您的计划。 这里将提供信息,让您知道改变了什么。 如果你看到“Merge Join Cartesian”,那么规划师就会出错。 那个计划永远不会好。 完全扫描的内部循环具有相同的IO成本,但占用的内存和临时空间更少。 第三,你使用ANALYZE TABLE构建了统计数据。 别。 甚至甲骨文也表示它很糟糕而且很糟糕。 使用dbms_st ...
  • DROP INDEX 完全降低了索引。 事务必须在新查询生效之前提交,但这通常不是问题。 您可能正在看到其他测试工件,例如: 统计数据略有变化后,Postgres会翻转到其他查询计划。 这表明您的费用设置可能不合适或其他一些不良配置。 重复执行查询已填充缓存(这可能对大表产生很大影响)。 对于中途可比较的结果,所有候选人都会进行几次。 您的查询基于“最后十分钟”。 可以有1000行,10分钟后,可以只有1.可以产生很大的不同。 询问 对于初学者,删除完全不必要的部分: SELECT COUNT(*) AS ...
  • 最后,我找到了在很短的时间内完成此查询的方法! 查询是: select distinct (B.NameDastgahID), B.ZarfiateHmaleBar, B.ShomarePelak, B1.NameDastgahTitle, B2.NameKhodroTitle, B3.NoeKhodroTitle, B4.KarbarieKhodroTitle, B5.ShahreKhodroTitle from dw.bohran_fct_etelaatenavegankhodroyi B INNE ...
  • 如果不使用“ORDER BY”,运行查询需要多长时间? 如果大约相同的时间,则查询没有优化可能性。 (也许投资更好的硬件/更快的磁盘 - 或调整你的mysql服务器值进行优化?) 如果它快得多,您可以尝试在tblProduct.ProductName上创建索引。 但是,如果这有帮助的话,不是不可取的 How long does it take to run the query if you do not use "ORDER BY"? If this is about the same amount of ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)