找到你要的答案

Q:Solr case insensitive search

Q:Solr不区分大小写的搜索

Im trying to set up a case insensitive search for bunch of XML documents. Is there a inbuilt field type that i can use? Im using Solr 5.2.1, I tried all stack overflow responses

SOLR Case Insensitive Search how to make field search not case-sensitive in solr using solrnet

I added a custom field in schema.xml which is inside solr-5.2.1\example\example-DIH\solr\solr\schema.xml

should this field appear in schema browser in the web UI? Im also not getting it there. this is the filed type :

<fieldType name="string_ci" class="solr.TextField"
        sortMissingLast="true" omitNorms="true">
        <analyzer>
            <tokenizer class="solr.KeywordTokenizerFactory"/>           
            <filter class="solr.LowerCaseFilterFactory" />
        </analyzer>
    </fieldType> 

this is my xml:

<doc>
<field name="id">
70
change.me</field>
<field name="title1" type="string_ci">
Hatton Matale
</field>
<field name="title2" type="text_general">
Kotagala Kandy
</field>
</doc>

this is my query :

title2:*kandy*

http://localhost:8983/solr/CaseTest/select?=title2%3Akandy&wt=json&indent=true

IM试图建立一个不敏感的搜索一堆XML文档。有一个内置的字段类型,我可以用吗?我使用Solr 5.2.1,我试过所有的栈溢出效应

SOLR Case Insensitive Search how to make field search not case-sensitive in solr using solrnet

I added a custom field in schema.xml which is inside solr-5.2.1\example\example-DIH\solr\solr\schema.xml

should this field appear in schema browser in the web UI? Im also not getting it there. this is the filed type :

<fieldType name="string_ci" class="solr.TextField"
        sortMissingLast="true" omitNorms="true">
        <analyzer>
            <tokenizer class="solr.KeywordTokenizerFactory"/>           
            <filter class="solr.LowerCaseFilterFactory" />
        </analyzer>
    </fieldType> 

这是我的xml:

<doc>
<field name="id">
70
change.me</field>
<field name="title1" type="string_ci">
Hatton Matale
</field>
<field name="title2" type="text_general">
Kotagala Kandy
</field>
</doc>

这是我的查询:

title2:*kandy*

HTTP:/ /本地:8983 / Solr /用例/选择?=题目二% 3akandy &;重量= JSON &;缩进=真

answer1: 回答1:

You can use the below fieldType. It will break the text stream into token by white space and convert to lower case before indexing.

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  <analyzer>
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

你可以使用下面的FieldType。它将文本流分解成令牌,然后转换为小写,然后再进行索引。

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  <analyzer>
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>
solr  lucene  solr4  solrnet  solrcloud