I have several facets which are happy with a hard limit of up to 100 - but as soon as I change the hard limit to "no limit", and save the changes, the search/filter page containing the facet gives an error (repeated twice):
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1 OFFSET 0' at line 2

I'm using the Database Search 7.x-1.0-beta2

CommentFileSizeAuthor
#2 1550772--facets-no-limit-1.patch397 bytesdrunken monkey

Comments

drunken monkey’s picture

Project: Search API » Search API Database Search
Version: 7.x-1.0 » 7.x-1.x-dev
Component: Facets » Code
Status: Active » Needs review

Thanks for reporting!
Please test the attached patch which should solve the issue.

drunken monkey’s picture

StatusFileSize
new397 bytes
adam_b’s picture

Status: Needs review » Fixed

Yes thanks - fixed that issue and some others (eg facets with only 1 entry weren't appearing although the filter was set so they should). Takes a while to load, but when unlimited = 500+, that's not surprising.

drunken monkey’s picture

By the way: in #1433644: Fails with unlimited facets, drewish actually posted the same patch before you created this issue. I'll therefore also credit it to him.

Anyways, thanks for testing! Committed.

PS: Please use "reviewed & tested by the community" to indicate a working patch, "fixed" is for already committed patches. Just might have overlooked this now …

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

joseph.olstad’s picture

This patch solved the SQLSTATE[42000]: Syntax error or access violation: error I was having when trying to use an index with a date field facet.

Good job on the patch!

SophieG’s picture

Thanks ! FYI it has been committed (I don't get the error with the dev version)