Gravatar for

Question by pblrok, Dec 5, 2017 10:26 AM

Coveo Hive and Coveo Related Query

Query has correct result. But component display the same results and result count as Coveo Search Interface query results. And Query Filter component accept rules to both query.

Can anyone help?

1 Reply
Gravatar for

Answer by François Lachance-Guillemette, Dec 5, 2017 1:26 PM

Let me do a quick overview of the component to see if you understand its features and how it works:

The Related Query is used to execute similar but different query related to another one.

For instance, if you are in a library online store and are in the "All Content" section, containing both authors and books.

The component helps you display, say on a sidebar, only books.

To configure it to your liking, you have to understand a few of its options:

1.1 Use the search interface current filters

This basically matches the `aq` part of the query: Facets, filter expressions, and many more.

For instance, if you are searching for Authors and click on the "Genre: Fantasy" facet, this will update the related query to also match this genre.

If you disable this option, your related query will match just about anything in the index, since it does not replicate the "local instance" filter. So you need to add a couple of filters back.

This is useful if you want to display completely different results than the search interface, like external content.

1.2 Use the search interface current query

This adds the current query in the search box to the related query.

For instance, if I am searching for "Children books", you might get Authors for children books in your main query, but books in your related query.

If you disable this option, it makes it so the query will not take what the user entered in the search box.

This is useful if you want a more static view of the results, and it might be useful if you are directly on an author page and want to search for Books related to that author instead.

1.3 Results per page

Since this is a different query than the search interface, you can configure its own number of results

1.4 Main Search Interface

A little less useful, but allows you to bind a Related Query to a specific Search Interface, if your Related Query is not directly inside the Search Interface.

2. Query Filters

In Coveo for Sitecore Hive, there are now "Scopes" components. These contain the filters and boost that you are used to in a basic Search Interface, but they can now be included as a component with its own data source.

This allows you to create a filter with a data source like "Only Books", and then insert it in your Related Query component. This should apply your filter _only_ in your Related Query component.

When the Related Query component is properly configured, you can have very powerful side-queries executed which can help your end-user in very specific places :)

I hope this overview helps you understand it and find the problem! :)

Gravatar for

Comment by pblrok, Dec 5, 2017 2:41 PM

I understand it.

I try configure Related Query like it was in my pages in version 4.0.

But the problem is that the component shows 10 items but i set 4 (Results Per Page property) and the related query has correct data (i see 4 data raws) but displays other data.

Maybe I should use a different result list datasource for Related Query results?

Now I use one for search interfacet results and recommendations results and related query results. But the problem only with the related query.

It looks like search interface put query result in both result components.

Does Query Filters work for all licence types?

Ask a question