我正在使用solr.TextField而不是solr.DateField来存储日期值。 假设我有一个“日期”字段值=“20/10/2014,20/5/2015”的记录,我试图搜索“20/10/2014”以获取此记录。但它不起作用。 我的查询如下:q=*:*&fq=date:20/10/2014
请帮助我如何配置字段或查询以获取记录。Solr文本搜索不起作用
<field name="date" type="text_general" indexed="true" stored="true"/>
<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" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
我只是尝试与查询q = *:*&fq =评论:坑/颠簸,我的评论也是像你的text_general类型,它实际上是为我工作。我也注意到你只是:,那是为什么你不能得到结果? – JaredLuo 2014-09-04 06:37:05
对不起,有错别字。我使用debugQuery = true来检查它如何分析20/10/2014。它简单地分成日期= 20日期= 10日期= 2014年,这是行不通的。 – user2051823 2014-09-04 07:30:47