popularity
is just "some field" which has been used as an example while boost
is a query parameter defined for the edismax
request handler. Boosting means to influence the scoring (the relevance of each search hit) depending on some field value (or result of some function based on field values).
See section The boost Parameter
in https://cwiki.apache.org/confluence/display/solr/The+Extended+DisMax+Query+Parser.
If you want to implement something like popularity
in your own index you would have to:
- add a field to your schema called
popularity
with type int
or float
or ExternalFileField
(depends on how you index and apply it).
- gather statistics data for your search results and store those in relation to the document IDs (e.g. by evaluating access logs)
- during index time or via
ExternalFileField
(or in the future via docValues
partial updates) store the popularity values that you get from your statistics data.
- apply the boost during query time by setting the parameter
boost=popularity
(or using popularity
in a function query).
More on popularity boosting:
https://www.slideshare.net/lucenerevolution/potter-timothy-boosting-documents-in-solr
docValues partial update:
https://issues.apache.org/jira/browse/SOLR-5944
ExternalFileField:
http://www.findwise.com/blog/externalfilefield-in-solr/