如何使用 Lucene Luke 测试多个字段的搜索结果?
How to use Lucene Luke for testing search results on more than one field?
我正在使用 Lucene Luke 来测试搜索索引结果,并注意到我无法在 'Default field' 下拉列表中 select 多于一个字段。这是设计使然还是我们不能使用 Luke 工具搜索多个字段?
基本上我想知道 Lucene 中的 SOLR qf(查询字段)等价物。
谢谢
您可以使用格式 field:query
进行搜索。
详情见:https://lucene.apache.org/core/8_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description
Lucene supports fielded data. When performing a search you can either
specify a field, or use the default field. The field names and default
field is implementation specific.
You can search any field by typing the field name followed by a colon
":" and then the term you are looking for.
As an example, let's assume a Lucene index contains two fields, title
and text and text is the default field. If you want to find the
document entitled "The Right Way" which contains the text "don't go
this way", you can enter:
title:"The Right Way" AND text:go or
title:"The Right Way" AND go Since text is the default field, the
field indicator is not required.
Note: The field is only valid for the term that it directly precedes,
so the query
title:The Right Way Will only find "The" in the title field. It will
find "Right" and "Way" in the default field (in this case the text
field).
我正在使用 Lucene Luke 来测试搜索索引结果,并注意到我无法在 'Default field' 下拉列表中 select 多于一个字段。这是设计使然还是我们不能使用 Luke 工具搜索多个字段?
基本上我想知道 Lucene 中的 SOLR qf(查询字段)等价物。
谢谢
您可以使用格式 field:query
进行搜索。
详情见:https://lucene.apache.org/core/8_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description
Lucene supports fielded data. When performing a search you can either specify a field, or use the default field. The field names and default field is implementation specific.
You can search any field by typing the field name followed by a colon ":" and then the term you are looking for.
As an example, let's assume a Lucene index contains two fields, title and text and text is the default field. If you want to find the document entitled "The Right Way" which contains the text "don't go this way", you can enter:
title:"The Right Way" AND text:go or
title:"The Right Way" AND go Since text is the default field, the field indicator is not required.
Note: The field is only valid for the term that it directly precedes, so the query
title:The Right Way Will only find "The" in the title field. It will find "Right" and "Way" in the default field (in this case the text field).