简体   繁体   中英

Frequency of the matched string in solr

I am indexing pdfs in my application. I want to show the frequency of the searched string in each pdf. I am using debugQuery=true and parsing the debug result. I am setting debug.explain.structured=true.

For eg: Input-foo then it will list all the pdfs in which this foo occurs. Output-cover.pdf 2 matches found(Just an example)

This works fine but the situation when I search for multiple words. Input- foo AND bar

The format of the debug result changes. Ok fine, I parsed this format also but its giving the frequency of only foo but nor bar.

Can anybody please tell me how to get the frequency of the searched words. I have checked termfrequency but we cant give multiple words there also.

What about using highlighting for that? It will create an entry per match in a doc

您可以在查询中使用构面,它也会返回该构面的计数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM