Lucene 使用“Solr”进行镶嵌;“字符串”;“字段”;“文本”;字段和;“复制”;领域

Lucene 使用“Solr”进行镶嵌;“字符串”;“字段”;“文本”;字段和;“复制”;领域,lucene,solr,facet,Lucene,Solr,Facet,我对Solr和Faceting有一个问题,我想知道是否有人知道这个补丁。我现在有一个解决办法,但是我真的想弄清楚为什么我的查询不起作用 这是我的模式,简化后更易于遵循: <fields> <field name="uniqueid" type="string" indexed="true" required="true"/> <!-- Indexed and Stored Field ---> <field name="recor

我对Solr和Faceting有一个问题,我想知道是否有人知道这个补丁。我现在有一个解决办法,但是我真的想弄清楚为什么我的查询不起作用

这是我的模式,简化后更易于遵循:

<fields>
    <field name="uniqueid" type="string" indexed="true" required="true"/>
    <!-- Indexed and Stored Field --->
    <field name="recordtype" type="text" indexed="true" stored="true"/>
    <!-- Facet Version of fields -->
    <field name="frecordtype" type="string" indexed="true" stored="false"/>
</fields>

<!-- Copy fields for facet searches -->
<copyField source="recordtype" dest="frecordtype"/>
我没有得到任何结果,但事实仍然显示有1项记录

<result name="response" numFound="0" start="0" /> 
 <lst name="facet_counts">
  <lst name="facet_queries" /> 
 <lst name="facet_fields">
 <lst name="frecordtype">
  <int name="Large Record">1</int> 
  <int name="Small Record">12</int> 
  <int name="Other">1</int> 
  </lst>
  </lst>
  <lst name="facet_dates" /> 
  </lst>
我得到了我想要的1结果

<result name="response" numFound="1" start="0" /> 
 <lst name="facet_counts">
  <lst name="facet_queries" /> 
 <lst name="facet_fields">
 <lst name="frecordtype">
  <int name="Large Record">1</int> 
  <int name="Small Record">12</int> 
  <int name="Other">1</int> 
  </lst>
  </lst>
  <lst name="facet_dates" /> 
  </lst>

1.
12
1.
所以我的问题是,为了得到查询的第一个版本以返回我想要的结果,我需要做些什么?也许这与URL编码或其他有关?任何来自solr大师或其他方面的提示都将非常感激

注意:这不是刻面问题所必需的,因为刻面实际上正在工作。这更像是一个查询问题,因为我无法对“字符串”字段执行查询,即使大小写和间距与索引版本完全相同

编辑:有关刻面的更多信息,请查看以下博客:

谢谢


Dave

您需要在值周围加引号

例如

frecordtype:“大记录”

工作

frecordtype:大记录


这将在frecordtype中搜索Large,但不会返回任何内容。。然后在solr中的默认字段中进行记录。

Arrhhh将其整理出来。。。需要在值周围加引号,并加空格:)
http://localhost:8080
/solr
/select
?version=2.2
&facet.field=%7b!ex%3dfrecordtype%7dfrecordtype
&facet=on
&fq=%7b!tag%3dfrecordtype%7drecordtype%3aLarge%20Record
&f1=*%2cscore
&rows=20
&start=0
&qt=standard
&q=text%3a%25
<result name="response" numFound="1" start="0" /> 
 <lst name="facet_counts">
  <lst name="facet_queries" /> 
 <lst name="facet_fields">
 <lst name="frecordtype">
  <int name="Large Record">1</int> 
  <int name="Small Record">12</int> 
  <int name="Other">1</int> 
  </lst>
  </lst>
  <lst name="facet_dates" /> 
  </lst>