配置solr自动生成id

2019-03-27 01:27|来源: 网路

schema.xml

====================================================

<field name=”id” type=”uuid” indexed=”true” stored=”true” required=”true” />

<fieldType name=”uuid” class=”solr.UUIDField” indexed=”true” />

 

solrconfig.xml

====================================================

#添加uuid

<updateRequestProcessorChain name=”uuid”>

<processor class=”solr.UUIDUpdateProcessorFactory”>

<str name=”fieldName”>id</str>

</processor>

<processor class=”solr.RunUpdateProcessorFactory” />

</updateRequestProcessorChain>

 

#修改/update requestHandler

<requestHandler name=”/update” class=”solr.UpdateRequestHandler”>

<lst name=”defaults”>

<str name=”update.chain”>uuid</str>

</lst>

</requestHandler>


转自:http://www.solr.cc/blog/?p=212

相关问答

更多
  • tomcat配置数据源solr使用数据源 1、tomcat中配置数据源(注:需要拷贝jdbc相关jar包到tomcat中。tomcat6.x/lib目录下,注意tomcat6.0以下的版本在tomcat5.x/common/lib/目录下) 在server.xml文件,找到“Engine-> Host -> Context”,在其下面配置主要针对某一项目的数据源使用。 在context.xml文件,找到“Context”,在其下面配置可以让所有项目使用。 在Context下面配置数据源如下: 数据源相关参数 ...
  • 主键是表中的一个或多个字段,它的值用于惟一地标识表中的某一条记录.;使用索引可快速访问数据库表中的特定信息。索引是对数据库表中一列或多列的值进行排序的一种结构,只有当经常查询索引列中的数据时,才需要在表上创建索引。
  • tomcat配置数据源solr使用数据源 1、tomcat中配置数据源(注:需要拷贝jdbc相关jar包到tomcat中。tomcat6.x/lib目录下,注意tomcat6.0以下的版本在tomcat5.x/common/lib/目录下) 在server.xml文件,找到“Engine-> Host -> Context”,在其下面配置主要针对某一项目的数据源使用。 在context.xml文件,找到“Context”,在其下面配置可以让所有项目使用。 在Context下面配置数据源如下: & ...
  • Solr 3.X有一个内置的建议器组件,允许您在有限的字段上构建建议。 以下链接提供了实施细节 - 1. http://lucidworks.lucidimagination.com/display/solr/Suggester 2. http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/ 对于其他方法,您可以检查EdgeNGrams实施或术语组件 。 Solr 3.X has an inbuilt Suggester component, wh ...
  • 我解决了这个问题,它是关于Cygwin文件夹的文件权限,Solr colud不创建文件夹。 我手动更改了访问权限。 I solved the problem, it was about file permissions at Cygwin folder, the Solr coludn't create folders. I changed manually the access rights.
  • 我建议你几个博文: 我写的这篇文章向您展示了您在Solr中有哪些开箱即用的选项以及为了选择其中一个而需要回答的问题 这个向您展示一个非常好的完整解决方案,该解决方案运行良好但需要进行一些额外的工作,并使用特定的lucene索引(solr core)用于特定目的 I would suggest you a couple of blogpost: This one which shows you a really nice complete solution which works well but requi ...
  • 您可以跨不同的核心加入语法,例如: {!from from = fromId to = toId fromIndex = Core2}查询 所以如果你有两个核心看起来像 PersonCore - ID,名称 AddressCore - ID,地址,PersonID 您可以通过查询PersonCore找到特定地址的所有人,如下所示: {!join from=PersonID to=ID fromIndex=AddressCore}Address:Address1 您只能拥有一个UniqueKey。 有可能自 ...
  • 最新的Solr作为独立黑匣子运行。 不要看Tomcat信息的古老教程,它们不再有用。 这是通过.NET客户端连接到它的一个单独问题。 对于客户端部分,SolrNet的源代码版本更新。 它应该与最新的Solr一起工作,主要问题是Solr的URL现在必须包含集合名称,所以http:// localhost:8983 / solr / collectionname 。 检查参数以设置核心或集合或类似。 还有Solr Express,你可能想看看。 Latest Solr runs as standalone bl ...
  • 创建自定义生成的ID很有趣,但是受虐狂。 你的潜意识目标是什么? AUTO_INCREMENT经过优化; 其他任何事情都是稍微有点低效的。 例如,触发器可能会使INSERT的成本翻倍,但如果INSERTs不是性能问题,那么“那么怎么办”。 半相关:由于其随机性,UUID对于巨大的表非常低效。 Creating custom-generated ids is fun, but masochistic. What is your subconscious goal? AUTO_INCREMENT is well ...
  • 你应该在https://github.com/evolvingweb/ajax-solr上看看'AJAX Solr'。 AJAX Solr具有自动完成小部件等功能。 演示网站 - http://evolvingweb.github.io/ajax-solr/examples/reuters/index.html 。 You should take a good look at 'AJAX Solr' at https://github.com/evolvingweb/ajax-solr . AJAX Sol ...