> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Methods

> Recommendations and boosting

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/lucidworks-search/07-improve-your-queries/recommendations/methods-recs

[mintlify link]: https://doc.lucidworks.com/docs/lucidworks-search/07-improve-your-queries/recommendations/methods-recs

[old doc.lw link]: https://doc.lucidworks.com/managed-fusion/5.9/l0emoh

This topic provides an overview of different methods for generating recommendations and boosts. "Content-based" and "collaborative" recommendations are two broad categories. More specific recommendation methods are also explained.

<LwTemplate />

## Content-based vs collaborative recommendations

Recommendation methods can be divided into two broad categories: collaborative recommendations and content-based recommendations.

Collaborative recommendations always require signals. Some also require a job that pre-computes a matrix of values that can be queried. When these values are used for boosting, then certain query pipeline stages are needed as well.

| Method                                                                                                              | Requires aggregated signals | Required job                                                                                                                                           | Boosting stage                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Collaborative recommendations** These methods analyze how users have interacted with documents.                   |                             |                                                                                                                                                        |                                                                                                                                                       |
| [Items-for-item](/docs/lucidworks-search/07-improve-your-queries/recommendations/items-for-item)                    | ✓                           | [BPR Recommender](/docs/lucidworks-search/09-developer-documentation/config-specs/jobs/bpr-recommender)                                                | <a href="/assets/attachments/pipelines/APPName_item_item_rec_pipelines_bpr.json" download>Download the `APPName_item_item_rec_pipelines_bpr.json`</a> |
| [Items-for-user](/docs/lucidworks-search/07-improve-your-queries/recommendations/items-for-user)                    | ✓                           | [BPR Recommender](/docs/lucidworks-search/09-developer-documentation/config-specs/jobs/bpr-recommender)                                                | [Recommend Items for User](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/recommend-items-for-user)            |
| [Items-for-query](/docs/lucidworks-search/07-improve-your-queries/recommendations/items-for-query)                  | ✓                           | [Query-to-Query Session-Based Similarity jobs](/docs/lucidworks-search/09-developer-documentation/config-specs/jobs/query-to-query-session-similarity) |                                                                                                                                                       |
| [Queries-for-query](/docs/lucidworks-search/07-improve-your-queries/recommendations/queries-for-query)              | ✓                           | [Query-to-Query Session-Based Similarity jobs](/docs/lucidworks-search/09-developer-documentation/config-specs/jobs/query-to-query-session-similarity) |                                                                                                                                                       |
| [Boost with signals](/docs/lucidworks-search/07-improve-your-queries/boosting/boost-with-signals)                   | ✓                           |                                                                                                                                                        | [Boost with Signals](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/boost-with-signals)                        |
| [Trending items or queries](/docs/lucidworks-search/07-improve-your-queries/recommendations/trending-items-queries) | ✓                           | [Trending Recommender](/docs/lucidworks-search/09-developer-documentation/config-specs/jobs/trending-recommender)                                      |                                                                                                                                                       |
| [Users-for-item recommendations](/docs/lucidworks-search/07-improve-your-queries/recommendations/users-for-item)    | ✓                           | [BPR Recommender](/docs/lucidworks-search/09-developer-documentation/config-specs/jobs/bpr-recommender)                                                |                                                                                                                                                       |
| **Content-based recommendations** These methods analyze the content of documents or queries.                        |                             |                                                                                                                                                        |                                                                                                                                                       |
| [Items-for-item](#items-for-item-recommendations)                                                                   |                             | [Content-Based Recommender](/docs/lucidworks-search/09-developer-documentation/config-specs/jobs/content-recommend)                                    | <a href="/assets/attachments/pipelines/APPName_item_item_rec_pipelines_content.json" download>`APPName_item_item_rec_pipelines_content.json`</a>      |
| [Boost documents](#boost-documents)                                                                                 |                             |                                                                                                                                                        | [Boost Documents](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/boost-documents)                              |
| [Parameterized boosting](#parameterized-boosting)                                                                   |                             |                                                                                                                                                        | [Parameterized Boosting](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/parameterized-boosting)                |
| [More Like This](#more-like-this)                                                                                   |                             |                                                                                                                                                        | [Solr MoreLikeThis](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/solr-morelikethis)                          |
| [Business rules](#business-rules)                                                                                   |                             |                                                                                                                                                        | [Apply Rules](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/apply-rules)                                      |

## Lucidworks Search recommendation and boosting methods

This section provides an overview of each method, with links to more detailed topics.

| Collaborative recommendations                                                                                                                                                                                                                                                                                                                                                                                   | Content-based recommendations                                                                                                                                                                                                             |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| • [Items-for-item](#items-for-item-recommendations)<br />• [Items-for-user](#items-for-user-recommendations)<br />• [Items-for-query](#items-for-query-recommendations)<br />• [Queries-for-query](#queries-for-query-recommendations)<br />• [Boost with signals](#boost-with-signals)<br />• [Trending items or queries](#trending-items-or-queries)<br />• [Users-for-item](#users-for-item-recommendations) | • [Items-for-item](#items-for-item-recommendations)<br />• [Boost Documents](#boost-documents)<br />• [Parameterized Boosting](#parameterized-boosting)<br />• [More Like This](#more-like-this)<br />• [Business rules](#business-rules) |

When you [enable recommendations](/docs/lucidworks-search/07-improve-your-queries/recommendations/getting-started#enable-recommendations), this automatically enables the items-for-user and items-for-item recommendation methods. To use additional recommendation methods, you must configure them separately.

### Items-for-item recommendations

Items-for-item recommendations present items that are similar to a specified item. For example, when the user is viewing a BMX bicycle, Lucidworks Search can recommend other BMX bicycles. Similarity can be based on different criteria, such as click patterns, people who bought this also bought that, percentage match of document tags, and so on.

See [Items-for-Item Recommendations](/docs/lucidworks-search/07-improve-your-queries/recommendations/items-for-item) for details.

### Items-for-user recommendations

Items-for-user recommendations use the [Recommend items for user](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/recommend-items-for-user) query stage to present items that are similar to ones in which the user has previously shown interest, based on the user’s search history, browsing history, purchase history, and so on. This is one type of [collaborative recommendation](/docs/lucidworks-search/07-improve-your-queries/recommendations/methods-recs#content-based-vs-collaborative-recommendations).

See [Items-for-User Recommendations](/docs/lucidworks-search/07-improve-your-queries/recommendations/items-for-user) for details.

### Items-for-query recommendations

The Items for Query recommender is the primary algorithm that supports recommendations on the search results page.

Items-for-query recommendations are based on how other users interacted with search results from the same query. This is one type of [collaborative recommendation](/docs/lucidworks-search/07-improve-your-queries/recommendations/methods-recs#content-based-vs-collaborative-recommendations).

For example, if users have searched for "titanic" in the past and many of them clicked on the search result for the DVD of the movie *Titanic* (as opposed to books or memorabilia), then this method boosts the DVD item on subsequent searches for "titanic".

See [Items-for-Query Recommendations](/docs/lucidworks-search/07-improve-your-queries/recommendations/items-for-query) for details.

### Queries-for-query recommendations

Queries-for-query recommendations are queries performed by other users who also performed the current query. For example, when a user searches for "madonna", your app may also suggest searches for "evita", "a league of their own", "lady gaga", and so on.

See [Queries for Query](/docs/lucidworks-search/07-improve-your-queries/recommendations/queries-for-query) for details.

### Boost with signals

The Boost With Signals query pipeline stage performs automatic boosts based on the contents of the aggregated signals collection. For this type of boosting, signals must be enabled but recommendations need not be.

See [Boost With Signals](/docs/lucidworks-search/07-improve-your-queries/boosting/boost-with-signals) for details.

### Trending items or queries

The [Trending Recommender job](/docs/lucidworks-search/09-developer-documentation/config-specs/jobs/trending-recommender) analyzes signals to measure customer engagement over time. Use this job to identify spikes in popularity for specific items or queries, then display those items to your users or analyze the trends for business purposes. You can configure any time window, such as daily, weekly, or monthly.

See [Trending items or queries](/docs/lucidworks-search/07-improve-your-queries/recommendations/trending-items-queries) for details.

### Users-for-item recommendations

Users-for-item recommendations retrieve the set of users who have interacted with an item, weighted by the number of interactions. This can be useful for community-driven use cases or for marketing campaigns. For example, on your organization’s intranet, clicking a search result could display the item plus a list of colleagues who have interacted with the same item.

See [Users-for-Item Recommendations](/docs/lucidworks-search/07-improve-your-queries/recommendations/users-for-item) for details.

### Boost documents

The Boost Documents query pipeline stage adds boosting parameters to matched documents based on user-defined rules. Boosts are defined with a term value to boost and the boost factor to add. The boosting parameters are added to the `bq` Solr query parameter.

See [Boost Documents](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/boost-documents) for details.

### Parameterized boosting

The Parameterized Boosting query pipeline stage reads the `boostValues` (in `List<DocumentResult>` format) from the context variable (added by a [Rollup Aggregation stage](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/rollup-aggregation) or a [JavaScript stage](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/javascript-query)), and adds boosts to the main query using `bq` or `boost` based on the stage configuration. The weights for the boost values can also be scaled.

See [Parameterized Boosting](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/parameterized-boosting) for details.

### More like this

This stage uses the content of the current document to query for similar documents, using Solr’s MoreLikeThis component.

This stage provides content-based recommendations. For collaborative recommendations, use the [Recommend Items for Item stage](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/recommend-items-for-item).

See [Solr MoreLikeThis](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/solr-morelikethis) for details.

### Business rules

Business rules are manually-created formulas for rewriting queries. This is the most versatile strategy for creating custom query rewrites. It supports a variety of conditions and actions to address a wide range of use cases. When you need a very specific query rewrite, this is the best strategy.

Business rules are applied in the [Apply Rules stage](/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/apply-rules) of the query pipeline.

See [Business Rules](/docs/lucidworks-search/07-improve-your-queries/business-rules/overview) to learn how to create, edit, and publish business rules. See [Query Rewriting](/docs/lucidworks-search/07-improve-your-queries/query-rewriting/overview) for additional query rewriting methods.

## BPR algorithm

The Bayesian Personalized Ranking (BPR) algorithm is used to configure items-for-item, items-for-user, or user-for-item recommendations. The BPR job generates effective results in a short run time. See the [BPR Recommender](/docs/lucidworks-search/09-developer-documentation/config-specs/jobs/bpr-recommender) for more information.
