Solr:如何输入问题搜索?

Solr: how to type questions search?

我是 solr 的新手,我正在尝试建立一个问答系统。 我已经为一些维基百科页面建立了索引,例如 Nikola Tesla。 https://en.wikipedia.org/wiki/Nikola_Tesla

我的问题是:在 Solr 中是否可以以及如何将查询作为问题键入?

我将 Wikipedia 页面拆分为 "Contents"(对应于 SectionTitle),所以...对于查询 pageTitle:Nikola Tesla,我的结果是:

"response":{"numFound":23,"start":0,"docs":[
{
        "sectionTitle":"First Paragraph",
        "pageTitle":"Nikola Tesla",
        "text":["Born and raised in the Austrian Empire, Tesla received an advanced education in engineering and physics in the 1870s and gained practical experience in the early 1880s working in telephony and at Continental Edison in the new electric power industry.]},
{
        "sectionTitle":"Early years",
        "pageTitle":"Nikola Tesla",
        "text":["Nikola Tesla was born an ethnic Serb in the village Smiljan, Lika county, in the Austrian Empire (present day Croatia), on 10 July [O.S. 28 June] 1856. etc..]}]
  }}

我的schema如下:

  <field name="id" type="string" indexed="true" required="true" stored="true"/>
  <field name="pageTitle" type="text_en" indexed="true" stored="true"/>
  <field name="sectionTitle" type="text_en" indexed="true" stored="true"/>
  <field name="title" type="text_en" indexed="true" stored="true"/>
  <field name="text" type="text_general" indexed="true" stored="true"/>

是否可以输入查询作为问题?以及如何显示与问题相似的结果? 比如上面看...

如何键入查询 When Nikola Tesla born? 并获取段落:

"sectionTitle":"Early years",
"pageTitle":"Nikola Tesla",
"text":["Nikola Tesla was born an ethnic Serb in the village Smiljan, Lika county, in the Austrian Empire (present day Croatia), on 10 July [O.S. 28 June] 1856."]

或查询Where Nikola Tesla born?/Where Nikola Tesla raised?得到:

"Born and raised in the Austrian Empire, Tesla received...."?

提前致谢。

A proximity search looks for terms that are within a specific distance from one another.

To perform a proximity search, add the tilde character ~ and a numeric value to the end of a search phrase. For example, to search for a "apache" and "jakarta" within 10 words of each other in a document, use the search:

"jakarta apache"~10

The distance referred to here is the number of term movements needed to match the specified phrase. In the example above, if "apache" and "jakarta" were 10 spaces apart in a field, but "apache" appeared before "jakarta", more than 10 term movements would be required to move the terms together and position "apache" to the right of "jakarta" with a space in between.

您也可以在您的案例中尝试邻近搜索,如下所示。

text:"Nikola Tesla born?"~10

text:"Austrian Empire engineering"~10

text:"Tesla born?"~10

请参考 solr 管理工具中的图像。

对于text:"Nikola Tesla born?"~10

对于text:"Austrian Empire engineering"~10

对于 text:"Tesla born?"~10 查询为 "http://localhost:8983/solr/TestCore/select?q=text:"Tesla born?"~10"