How to incorporate multiple fields in QueryParser?

后端 未结 4 965
无人共我
无人共我 2020-12-12 13:41
Dim qp1 As New QueryParser(\"filename\", New StandardAnalyzer())
Dim qp2 As New QueryParser(\"filetext\", New StandardAnalyzer())
.
.

I am using th

4条回答
  •  独厮守ぢ
    2020-12-12 14:37

    for each field create a query from the above queryparsers, then add the query to a booleanquery stating that it "must" occur.

    Alternatively, check out the MultiFieldQueryParser, which is a simplified way of doing it.

提交回复
热议问题