Solr - 如何对单个查询进行多次搜索?

时间:2017-11-21 11:11:42

标签: apache search solr lucene search-engine

我正在尝试查询:

  • 首先尝试匹配字符串,只是小写处理,并生成分数,提升x
  • 其次,尝试使用'text_en'处理并生成分数,提升y
  • Trird,将'text_en'与同义词一起使用,并生成一个得分,boost z

这可能吗? 我做了以下配置,但我不认为它正在做我所描述的......它有效,但我不相信结果。

solrconfig.xml中:

  <requestHandler name="/querystems" class="solr.SearchHandler">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
      <str name="wt">json</str>
      <str name="indent">true</str>
      <str name="qf">
         lowercase^2 title_without_synonym description_without_synonym title_stems^1.5 description_stems^1
      </str>
      <str name="q.alt">*:*</str>
      <str name="rows">100</str>
      <str name="fl">id,title,description,reuseCount,score,title_stems,description_stems</str>
      <str name="defType">edismax</str>
    </lst>
  </requestHandler>

schema.xml中:

  <field name="title" type="text_en_test" indexed="true" stored="true"/>
  <field name="title_without_synonym" type="text_en_without_synonym" indexed="true" stored="true"/>
  <field name="title_stems" type="text_en_stems" indexed="true" stored="true"/>
  <copyField source="title" dest="title_without_synonym" maxChars="30000" />
  <copyField source="title" dest="title_stems" maxChars="30000" />

  <field name="description" type="text_en_test" indexed="true" stored="true"/>
  <field name="description_without_synonym" type="text_en_without_synonym" indexed="true" stored="true"/>
  <field name="description_stems" type="text_en_stems" indexed="true" stored="true"/>
  <copyField source="description" dest="description_without_synonym" maxChars="30000" />
  <copyField source="description" dest="description_stems" maxChars="30000" />

我甚至不知道为什么“小写”字段在查询配置中起作用,因为它是“fieldType”,而不是“字段”...有人可以帮助我,并且更好地配置这种情况吗?

0 个答案:

没有答案