文章分类 - solr
摘要:今天试了一下solr4的solrcloud部署,发现还是很方便的,借助zookeeper很容易实现高可用分布式部署,由于只是尝试,是在单机上部署,使用不同的端口实现,原理与多机器部署完全一样,本处采用独立的zookeeper集群部署,而没有使用solr集成的zookeeper,集成只能用开发环境部署...
阅读全文
摘要:在为用户提供搜索服务时,为了提供更好的用户体验,我们需要很好的处理同义词搜索。例如用户在搜索的关键词中含有“1”,需要将其转为为“一”,这时可以采用以下的方式去实现:首先,配置schema.xml文件,定义相应的域类型<fieldtype name="text_search" class="solr.TextField" omitNorms="true"> <analyzer type="index"> <tokenizer class="solr.StandardToken
阅读全文
摘要:接着上一节的内容,假如我们从mysql中导入进solr中的数据量比较大,所耗时比较长,如果每次都是进行完全导入,肯定是不好的做法,因此可以采取增量导入的方式,solr的相关配置如下所示:在 schema.xml的域信息定义如下:<field name="id" type="string" indexed="true" stored="true" required="true"/> <field name="title" type="text&quo
阅读全文
摘要:autocomplete 是什么相信你懂的,真的不知道的话,那就问百度吧直接上配置schema.xml <field name="id" type="string" indexed="true" stored="true" required="true"/> <field name="title" type="text" indexed="true" stored="true"/>类型定义:
阅读全文
摘要:下面演示如何从二进制文件,如:mp3中提取文件的相关信息,如标题、作者等首先还是展示一下我们的schema.xml文加<field name="id" type="string" indexed="true" stored="true" required="true"/><field name="author" type="string" indexed="true" stored="true" m
阅读全文
摘要:这节展示如何通过JDBC从mysql数据库中将数据导入进solr中假设数据库(blog)中有如下两个表:article,categoryarticle:id,title,catidcategory:id,catname接着需要做一下几个配置:在 schema.xml的域信息定义如下: <field name="id" type="string" indexed="true" stored="true" required="true"/> <field name="ti
阅读全文
摘要:如果我们有一个基于JavaScript的应用需要使用solr,此时再使用xml的格式可能就是一个很好的选择,因为它太大而且还需要转换。因此可以采用json,进行相应的处理。下面就是具体的实现方式:schema.xml的部分配置如下:<field name="id" type="string" stored="true" indexed="true"/><field name="name" type="string" stored="true&quo
阅读全文
摘要:一个偶然需求,需要对pdf(非扫描)文档进行索引,schema.xml<fields><fieldname="id"type="string"indexed="true"stored="true"required="true"/><fieldname="content"type="text_general"indexed="true"stored="true"required="
阅读全文
摘要:有时候我们有一些通过SQL导出的csv格式的文件如果需要导入到slor,可以采用以下的方法首先假定我们的schema.xml如下所示:<field name="id" type="string" stored="true" indexed="true"/><field name="name" type="string" stored="true" indexed="true"/><field name=&q
阅读全文
摘要:xml 是最常用的数据索引格式,不仅可以索引数据,还可以对文档与字段进行增强,从而改变它们的重要程度。下面就是具体的实现方式:schema.xml的字段配置部分如下:<field name="id" type="string" stored="true" indexed="true"/><field name="name" type="string" stored="true" indexed="true" omitN
阅读全文

浙公网安备 33010602011771号