Danbooru

Unexpected error when searching with notes:0

Posted under Bugs & Features

Getting this error while searching translated, noteupdater:{user} or noter:{user} search with 'notes:0'.
I know there are alternative searches but still.

Error
Unexpected error: ActiveRecord::StatementInvalid.

Details
ActiveRecord::StatementInvalid exception raised
app/logical/post_query_builder.rb:218:in `block in small_search'
app/logical/post_query_builder.rb:215:in `small_search'
app/logical/post_query_builder.rb:196:in `optimize_search'
app/logical/post_query_builder.rb:172:in `paginated_posts'
app/logical/post_query.rb:86:in `paginated_posts'
app/logical/post_sets/post.rb:109:in `posts'
app/controllers/posts_controller.rb:24:in `index'

pronebone said:

Getting this error while searching translated, noteupdater:{user} or noter:{user} search with 'notes:0'.
I know there are alternative searches but still.

What exactly are you trying to achieve?

From what I can see, that query is a contradiction in itself: You’re searching for posts that have notes updated/created by some user while at the same time having no notes at all.

Also, what alternatives to that would there be? I’m curious.

kittey said:

What exactly are you trying to achieve?

From what I can see, that query is a contradiction in itself: You’re searching for posts that have notes updated/created by some user while at the same time having no notes at all.

My guess would be that he's searching for posts with deleted notes.

Yeah, I was trying to find some one-off note removers on translated posts and posts that weren't translated tagged as translated.

This line from cheatsheet also threw me off a little on understanding the problem:

has:notes
Search for posts with notes. Equivalent to notes:>0

Since, for example id:1 -has:notes actually displays the first post while id:1 notes:0 doesn't.

I'd also expect a no result found or something than an outright error.
My alternative search method was using the "-has:notes" btw.

Updated

1