我在索尔特殊字符搜索时遇到问题。 我的文档有一个字段“标题”,有时它可以像“泰坦尼克号 - 1999”(它有字符“ - ”)。 当我尝试在solr中搜索“ - ”时,我收到400错误。我试图逃避角色,所以我尝试了“ - ”和“\ - ”之类的东西。随着更改solr不会回应我的错误,但它返回0结果。在索尔中搜索特殊字符
我怎么能在Solr管理与特殊字符搜索(类似于“ - ”或“'” ???
问候
UPDATE 在这里你可以看到我目前的Solr的方案https://gist.github.com/cpalomaresbazuca/6269375
我搜索到外地 “标题” 从schema.xml中
摘要:
...
<!-- A general text field that has reasonable, generic
cross-language defaults: it tokenizes with StandardTokenizer,
removes stop words from case-insensitive "stopwords.txt"
(empty by default), and down cases. At query time only, it
also applies synonyms. -->
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<!-- in this example, we will only use synonyms at query time
<filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
-->
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
...
<field name="Title" type="text_general" indexed="true" stored="true"/>
当您搜索时,是否将引号括起来?像选择?q =标题:“泰坦尼克号 - 1999”。把它放在引号中应该做一个确切的搜索 –
你的模式在这个领域看起来像什么?我很想知道你对这个领域有什么样的定义。 –
<字段名=“标题”类型=“text_general”存储=“真正的”索引=“真” /> –