Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Solr:字段中的高优先级_Solr_Lucene_Edismax - Fatal编程技术网

Solr:字段中的高优先级

Solr:字段中的高优先级,solr,lucene,edismax,Solr,Lucene,Edismax,我试图在solr中搜索,但我想优先搜索某个字段(即标题),而不是搜索其他字段(如“导演”)。 这是我的schema.xml的一部分 <fields> <field name="Id" type="string" indexed="true" stored="true" required="true"/> <field name="Title" type="text_general" indexed="true" stored="true"/>

我试图在solr中搜索,但我想优先搜索某个字段(即标题),而不是搜索其他字段(如“导演”)。 这是我的schema.xml的一部分

<fields>
    <field name="Id" type="string" indexed="true" stored="true" required="true"/>
    <field name="Title" type="text_general" indexed="true" stored="true"/>
    <field name="OriginalTitle" type="text_general" indexed="true" stored="true"/>
    <field name="Directors" type="text_general" indexed="true" stored="true" multiValued="true" required="false"/>
    <field name="Language" type="text_general" indexed="false" stored="true" required="false"/>
    <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
</fields>

<uniqueKey>Id</uniqueKey>

<defaultSearchField>text</defaultSearchField> 

<solrQueryParser defaultOperator="OR"/> 

<copyField source="Title" dest="text"/>
<copyField source="OriginalTitle" dest="text"/>
<copyField source="Directors" dest="text"/>
<copyField source="Keywords" dest="text"/>

身份证件
正文
这是我的请求处理程序:

<lst name="responseHeader">
  <int name="status">0</int>
  <int name="QTime">2</int>
  <lst name="params">
    <str name="lowercaseOperators">true</str>
    <str name="pf">Title^100 Directors^10</str>
    <str name="indent">true</str>
    <str name="q">fo*</str>
    <str name="qf">Title Directors</str>
    <str name="stopwords">true</str>
    <str name="wt">xml</str>
    <str name="defType">edismax</str>
  </lst>
</lst>

0
2.
真的
职位^100董事^10
真的
fo*
产权主管
真的
xml
埃迪斯马克斯
我的结果是:

<result name="response" numFound="4" start="0">
  <doc>
    <str name="Language">Ingles subtítulos español</str>
    <str name="Title">Footloose</str>
    <arr name="Directors">
      <str>Herbert Ross</str>
    </arr>
    <str name="OriginalTitle">Footloose (1984)</str>
</doc>
  <doc>
    <str name="Language">Ingles subtítulos español</str>
    <str name="Title">Amadeus</str>
    <arr name="Directors">
      <str>Milos Forman</str>
    </arr>
    <str name="OriginalTitle">Amadeus</str>
</doc>
  <doc>
    <str name="Language">Ingles subtítulos español</str>
    <str name="Title">Forrest Gump</str>
    <arr name="Directors">
      <str>Robert Zemeckis</str>
    </arr>
    <str name="OriginalTitle">Forrest Gump</str>
</doc>
  <doc>
    <str name="Language">Doblado al español</str>
    <str name="Title">Chimpancés</str>
    <arr name="Directors">
      <str>Alastair Fothergill</str>
      <str> Mark Linfield</str>
    </arr>
    <str name="OriginalTitle">Chimpanzee Esp</str>
</doc>
</result>

艾斯帕尼奥尔酒店
自由自在
赫伯特·罗斯
自由自在(1984)
艾斯帕尼奥尔酒店
阿马迪斯
米洛斯·福尔曼
阿马迪斯
艾斯帕尼奥尔酒店
阿甘正传
罗伯特·泽梅基斯
阿甘正传
多布拉多·艾斯帕尼奥尔
黑猩猩
阿拉斯泰尔·福瑟吉尔
马克林菲尔
黑猩猩
但我想要这个结果:

<result name="response" numFound="4" start="0">
  <doc>
    <str name="Language">Ingles subtítulos español</str>
    <str name="Title">Footloose</str>
    <arr name="Directors">
      <str>Herbert Ross</str>
    </arr>
    <str name="OriginalTitle">Footloose (1984)</str>
</doc>
  <doc>
    <str name="Language">Ingles subtítulos español</str>
    <str name="Title">Forrest Gump</str>
    <arr name="Directors">
      <str>Robert Zemeckis</str>
    </arr>
    <str name="OriginalTitle">Forrest Gump</str>
</doc>
<doc>
    <str name="Language">Ingles subtítulos español</str>
    <str name="Title">Amadeus</str>
    <arr name="Directors">
      <str>Milos Forman</str>
    </arr>
    <str name="OriginalTitle">Amadeus</str>
</doc>
  <doc>
    <str name="Language">Doblado al español</str>
    <str name="Title">Chimpancés</str>
    <arr name="Directors">
      <str>Alastair Fothergill</str>
      <str> Mark Linfield</str>
    </arr>
    <str name="OriginalTitle">Chimpanzee Esp</str>
</doc>
</result>
<lst name="debug">
<str name="rawquerystring">fo*</str>
<str name="querystring">fo*</str>
<str name="parsedquery">
(+DisjunctionMaxQuery((Directors:fo* | Title:fo*)) () ())/no_coord
</str>
<str name="parsedquery_toString">+(Directors:fo* | Title:fo*) () ()</str>
<lst name="explain">
<str name="10">
1.0 = (MATCH) sum of: 1.0 = (MATCH) max of: 1.0 = (MATCH) ConstantScore(Title:fo*), product of: 1.0 = boost 1.0 = queryNorm
</str>
<str name="2">
1.0 = (MATCH) sum of: 1.0 = (MATCH) max of: 1.0 = (MATCH) ConstantScore(Directors:fo*), product of: 1.0 = boost 1.0 = queryNorm
</str>
<str name="12">
1.0 = (MATCH) sum of: 1.0 = (MATCH) max of: 1.0 = (MATCH) ConstantScore(Title:fo*), product of: 1.0 = boost 1.0 = queryNorm
</str>
<str name="711">
1.0 = (MATCH) sum of: 1.0 = (MATCH) max of: 1.0 = (MATCH) ConstantScore(Directors:fo*), product of: 1.0 = boost 1.0 = queryNorm
</str>
</lst>
<str name="QParser">ExtendedDismaxQParser</str>
<null name="altquerystring"/>
<null name="boost_queries"/>
<arr name="parsed_boost_queries"/>
<null name="boostfuncs"/>
<lst name="timing">
<double name="time">4.0</double>
<lst name="prepare">
<double name="time">1.0</double>
<lst name="query">
<double name="time">1.0</double>
</lst>
<lst name="facet">
<double name="time">0.0</double>
</lst>
<lst name="mlt">
<double name="time">0.0</double>
</lst>
<lst name="highlight">
<double name="time">0.0</double>
</lst>
<lst name="stats">
<double name="time">0.0</double>
</lst>
<lst name="debug">
<double name="time">0.0</double>
</lst>
</lst>
<lst name="process">
<double name="time">3.0</double>
<lst name="query">
<double name="time">0.0</double>
</lst>
<lst name="facet">
<double name="time">0.0</double>
</lst>
<lst name="mlt">
<double name="time">0.0</double>
</lst>
<lst name="highlight">
<double name="time">0.0</double>
</lst>
<lst name="stats">
<double name="time">0.0</double>
</lst>
<lst name="debug">
<double name="time">3.0</double>
</lst>
</lst>
</lst>
</lst>

艾斯帕尼奥尔酒店
自由自在
赫伯特·罗斯
自由自在(1984)
艾斯帕尼奥尔酒店
阿甘正传
罗伯特·泽梅基斯
阿甘正传
艾斯帕尼奥尔酒店
阿马迪斯
米洛斯·福尔曼
阿马迪斯
多布拉多·艾斯帕尼奥尔
黑猩猩
阿拉斯泰尔·福瑟吉尔
马克林菲尔
黑猩猩
我应该在查询中做什么才能得到我想要的响应

更新: 关于debug=True,我得到了以下结果:

<result name="response" numFound="4" start="0">
  <doc>
    <str name="Language">Ingles subtítulos español</str>
    <str name="Title">Footloose</str>
    <arr name="Directors">
      <str>Herbert Ross</str>
    </arr>
    <str name="OriginalTitle">Footloose (1984)</str>
</doc>
  <doc>
    <str name="Language">Ingles subtítulos español</str>
    <str name="Title">Forrest Gump</str>
    <arr name="Directors">
      <str>Robert Zemeckis</str>
    </arr>
    <str name="OriginalTitle">Forrest Gump</str>
</doc>
<doc>
    <str name="Language">Ingles subtítulos español</str>
    <str name="Title">Amadeus</str>
    <arr name="Directors">
      <str>Milos Forman</str>
    </arr>
    <str name="OriginalTitle">Amadeus</str>
</doc>
  <doc>
    <str name="Language">Doblado al español</str>
    <str name="Title">Chimpancés</str>
    <arr name="Directors">
      <str>Alastair Fothergill</str>
      <str> Mark Linfield</str>
    </arr>
    <str name="OriginalTitle">Chimpanzee Esp</str>
</doc>
</result>
<lst name="debug">
<str name="rawquerystring">fo*</str>
<str name="querystring">fo*</str>
<str name="parsedquery">
(+DisjunctionMaxQuery((Directors:fo* | Title:fo*)) () ())/no_coord
</str>
<str name="parsedquery_toString">+(Directors:fo* | Title:fo*) () ()</str>
<lst name="explain">
<str name="10">
1.0 = (MATCH) sum of: 1.0 = (MATCH) max of: 1.0 = (MATCH) ConstantScore(Title:fo*), product of: 1.0 = boost 1.0 = queryNorm
</str>
<str name="2">
1.0 = (MATCH) sum of: 1.0 = (MATCH) max of: 1.0 = (MATCH) ConstantScore(Directors:fo*), product of: 1.0 = boost 1.0 = queryNorm
</str>
<str name="12">
1.0 = (MATCH) sum of: 1.0 = (MATCH) max of: 1.0 = (MATCH) ConstantScore(Title:fo*), product of: 1.0 = boost 1.0 = queryNorm
</str>
<str name="711">
1.0 = (MATCH) sum of: 1.0 = (MATCH) max of: 1.0 = (MATCH) ConstantScore(Directors:fo*), product of: 1.0 = boost 1.0 = queryNorm
</str>
</lst>
<str name="QParser">ExtendedDismaxQParser</str>
<null name="altquerystring"/>
<null name="boost_queries"/>
<arr name="parsed_boost_queries"/>
<null name="boostfuncs"/>
<lst name="timing">
<double name="time">4.0</double>
<lst name="prepare">
<double name="time">1.0</double>
<lst name="query">
<double name="time">1.0</double>
</lst>
<lst name="facet">
<double name="time">0.0</double>
</lst>
<lst name="mlt">
<double name="time">0.0</double>
</lst>
<lst name="highlight">
<double name="time">0.0</double>
</lst>
<lst name="stats">
<double name="time">0.0</double>
</lst>
<lst name="debug">
<double name="time">0.0</double>
</lst>
</lst>
<lst name="process">
<double name="time">3.0</double>
<lst name="query">
<double name="time">0.0</double>
</lst>
<lst name="facet">
<double name="time">0.0</double>
</lst>
<lst name="mlt">
<double name="time">0.0</double>
</lst>
<lst name="highlight">
<double name="time">0.0</double>
</lst>
<lst name="stats">
<double name="time">0.0</double>
</lst>
<lst name="debug">
<double name="time">3.0</double>
</lst>
</lst>
</lst>
</lst>

fo*
fo*
(+析取MaxQuery((董事:fo*|职务:fo*)())/不合作
+(董事:fo*|职务:fo*)()()
1.0=(匹配)和:1.0=(匹配)最大值:1.0=(匹配)ConstantCore(标题:fo*),乘积:1.0=boost 1.0=queryNorm
1.0=(匹配)的和:1.0=(匹配)的最大值:1.0=(匹配)ConstantCore(控制器:fo*),乘积:1.0=boost 1.0=queryNorm
1.0=(匹配)和:1.0=(匹配)最大值:1.0=(匹配)ConstantCore(标题:fo*),乘积:1.0=boost 1.0=queryNorm
1.0=(匹配)的和:1.0=(匹配)的最大值:1.0=(匹配)ConstantCore(控制器:fo*),乘积:1.0=boost 1.0=queryNorm
扩展分解器
4
1
1
0
0
0
0
0
3
0
0
0
0
0
3

您应该尝试对查询字符串进行解释(但debug=true或debugQuery=true),以查看查询的哪些元素得分。
看起来可能是频率之类的术语造成了差异。它还可能在文档之间建立联系,因为您没有太多的内容

您应该尝试对查询字符串进行解释(但debug=true或debugQuery=true),以查看查询的哪些元素得分。
看起来可能是频率之类的术语造成了差异。它还可能在文档之间建立联系,因为您没有太多的内容

您正在增强短语字段匹配,而不是查询字段匹配。您可能希望增强所有功能,尤其是因为您的搜索实际上不是一个短语:

<str name="pf">Title^100 Directors^10</str>
<str name="qf">Title Directors</str>
标题^100名董事^10
产权主管

尝试在qf字段上添加相同的权重。

您正在增强短语字段匹配,但不是查询字段匹配。您可能希望增强所有功能,尤其是因为您的搜索实际上不是一个短语:

<str name="pf">Title^100 Directors^10</str>
<str name="qf">Title Directors</str>
标题^100名董事^10
产权主管

尝试在qf字段中添加相同的权重。

谢谢,这对我很有用。现在我需要研究如何降低优先级,比如“to”,“a”和其他:)这就是StopFilterFactory。我认为您的默认配置已经使用了它,您可能只需要添加更多想要忽略的单词。但是,是的,那将是一个单独的问题。谢谢,这对我很有用。现在我需要研究如何降低优先级,比如“to”,“a”和其他:)这就是StopFilterFactory。我认为您的默认配置已经使用了它,您可能只需要添加更多想要忽略的单词。但是的,这将是一个单独的问题。