> ## 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.

# Trending Items and Queries

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/5/fusion/getting-data-out/query-enhancement/recommendations/trending-items

[mintlify link]: https://doc.lucidworks.com/docs/5/fusion/getting-data-out/query-enhancement/recommendations/trending-items

[old doc.lw link]: https://doc.lucidworks.com/fusion/5.9/crfvw5

The [Trending Recommender job](/docs/5/fusion/reference/config-ref/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.

<LwTemplate />

<img src="https://mintcdn.com/lucidworks/L5PMnIeZ03zhv8Ti/assets/images/5.4/trending-recommender-display.png?fit=max&auto=format&n=L5PMnIeZ03zhv8Ti&q=85&s=47772693e815217729602815cec3bb51" alt="Trending queries and products" width="2558" height="1382" data-path="assets/images/5.4/trending-recommender-display.png" />

For detailed steps to configure this job, see **Identify Trending Items or Queries**.

<Accordion title="Identify Trending Items or Queries">
  The Trending Recommender job 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.

  For complete details about the job’s configuration options, see [Trending Recommender Jobs](/docs/5/fusion/reference/config-ref/jobs/trending-recommender).

  **How to identify trending items or queries**

  1. Navigate to **Collections** > **Jobs** > **Add +** > **Trending Recommender**.
       <img src="https://mintcdn.com/lucidworks/tklssWuUmNaxlF0b/assets/images/5.3/trending-recommender-job.png?fit=max&auto=format&n=tklssWuUmNaxlF0b&q=85&s=c3fdb9781de1852568066a3458f04ae3" alt="Trending Recommender job configuration panel" width="2453" height="1296" data-path="assets/images/5.3/trending-recommender-job.png" />
  2. Configure the job:
     1. Enter an ID for this job.
     2. In the **Reference Time Days** field, enter the number of days to use as a *baseline* for identifying trends, starting from today.\
        For example, enter 21 days to analyze three weeks of signals data to use as a baseline.
     3. In the **Target Time Days** field, enter the number of days to use as a *target* for identifying trends, starting from today.\
        For example, enter 7 days to get documents or products whose popularity has spiked in the past week.
        <Tip>      **Reference Time Days** and **Target Time Days** do not overlap.  For example, with the values suggested above, a total of 28 days of signals are analyzed, and the first 21 days are compared to the last 7 days.</Tip>
     4. If you want to identify trending queries instead of trending items, change the value of the **Document ID Field** from `doc_id_s` to `query_s`.
        <Note>      This field must be present in your signals. See the required signals fields in the [Trending Recommender Jobs](/docs/5/fusion/reference/config-ref/jobs/trending-recommender) reference topic.</Note>
     5. In the **Training Collection** field, enter the Solr collection or cloud path where signals are stored (the `COLLECTION_NAME_signals` collection by default).
     6. In the **Output Collection** field, enter the Solr collection or cloud path where trend analysis data will be stored.
     7. If you are using a format other than `solr`, enter it in the **Data Format** field.
     8. In the **Solr Fields to Read** field, enter one or more field names containing text training data.
        <Tip>      You can enter multiple field names with weights, as in `field1:weight1,field2:weight2...`.</Tip>
     9. In the **Event Count Field Name** field, enter the name of the event count field in your training data, usually `count_i`.
  3. Click **Save**.
  4. Click **Run** > **Start** to run the job.
     The job outputs documents similar to this example:

  ```json theme={"dark"}
      {
             "doc_id":250,
             "ref_hits":1,
             "ref_rank":1,
             "trgt_hits":1,
             "trgt_rank":1,
             "vol_diff":0.5,
             "average_weekly_vol":0.5,
             "hit_vol_ratio":2.0,
             "combine_score":1.0,
             "vol_diff_ratio":1.0,
             "ref_wt_vol_diff_ratio":1.0,
             "vol_diff_wt_vol_diff_ratio":0.5,
             "log_diff_wt_ratio":1.3068528194400546,
             "trend-type":"prds_weekly",
             "id":"284f930d-d750-49a2-90ac-be4692bddda9",
             "_version_":1682995654191742976
       }
  ```

  5. Configure a query pipeline to retrieve trending items from the job’s output collection for display or further analysis. For information about pipelines created when recommendations are enabled, see [enable recommendations](/docs/5/fusion/getting-data-out/query-enhancement/recommendations/getting-started).

     <Tip>   Search on the `log_diff_wt_ratio` field to find the top trending items in the output collection.</Tip>

  <img src="https://mintcdn.com/lucidworks/L5PMnIeZ03zhv8Ti/assets/images/5.4/trending-recommender-display.png?fit=max&auto=format&n=L5PMnIeZ03zhv8Ti&q=85&s=47772693e815217729602815cec3bb51" alt="Trending queries and products" width="2558" height="1382" data-path="assets/images/5.4/trending-recommender-display.png" />
</Accordion>
