lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sokolov <msoko...@safaribooksonline.com>
Subject getting matching term count for a query
Date Mon, 18 Nov 2013 16:55:07 GMT
Some of our customers want to display a "number of matches" score next 
to each search result.  I think what they want is to list the number of 
matches that will be displayed when the entire document is highlighted.  
But this can be slow to do for every search result (some documents can 
be very large), so what we'd like to do is to count the number of terms 
that match the query for each document, and display that.

It looks like Solr's function query has some support for this - I see 
the termfreq function, for example.  My question is:

1. Is it possible to execute the query as usual, retrieving document 
stored field values, and also to run a function, and return the result 
as the value of a computed "pseudo-field"?

2. Is there an existing function known to the function query parser that 
counts the total number of occurrences of all terms in the query (for 
the current hit document)?

-Mike

Mime
View raw message