问题
What is document popularity in solr indexing..?
EDisMax parser uses boost parameter. In the example &boost=popularity
like that I noticed one query. I couldn't understand what is boost as well as boost=popularity. Before understanding the boost parameter I'd like to know what is "popularity" in document indexing.
回答1:
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 typeint
orfloat
orExternalFileField
(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 viadocValues
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 usingpopularity
in a function query).
More on popularity boosting:
https://www.safaribooksonline.com/blog/2014/11/04/implementing-popularity-boosting-in-search/
docValues partial update: https://issues.apache.org/jira/browse/SOLR-5944
ExternalFileField: http://www.findwise.com/blog/externalfilefield-in-solr/
回答2:
Boosting is used to increase the score of the certain documents. You can use index time boosting or query time boosting. For index time boosting you can set boost
attribute and value to the document you index. For query time boosting you can either boost field by setting your boost value, or you can use predefined function queries.
For more information about boosting check documents in Solr wiki.
boost=popularity means that documents popularity is calculated in the external field (using ExternalFileField) and used to increase the score by using popularity value. Popularity of the documents can be calculated using the view count or any other parameters you want.For more about boosting documents by popularity you can check this document.
来源:https://stackoverflow.com/questions/13677841/what-means-document-popularity-in-solr