Hello,

I recently have a problem with the facets for two different queries that return the same result.

I have followed the Search API guide to create a view with a search bar and I have added 2 facets (blocks) for the Type of the content and the Author of the content. My index includes files name, title, content type and author.

Suppose I search for "300x301" which is the beginning of the file name "300x301.obj" i got 22 results. The facets suggest me 3 users and 2 type of contents. If I type the entire name of the file "300x301.obj", it returns me 22 results but the facets suggest me 1 user and 1 type of content that are not related to the content.

After a lot of time of debugging, I finally find a solution that work for my case.

I take a look at the query that were executed on the page when I was searching and notice that the query to build the temporary table had a little difference with the one used to fetch the results of the query.

Temporary table query :

... GROUP BY t.item_id, w0, w1)t HAVING ( COUNT( DISTINCT t.word ) >=  '2' )

Results query (search API) :

... GROUP BY t.item_id, w0, w1)t GROUP BY t.item_id HAVING ( COUNT( DISTINCT t.word ) >=  '2' ) ...

There is a GROUP BY t.item_id missing after the w1)t.

By adding the missing group by, my problem was solved. I am currently creating the patch.

Comments

santerref’s picture

Status: Active » Closed (fixed)

Problem related to Search API DB module.