Reputation: 27
Hello I am using sunspot for searching: when I say:
keywords '"India" -"mountain"' do
minimum_match 1 end
It finds all the posts related to "India" keyword and which does not include "mountain" keyword. But when I want all the posts globally which should not include "mountain" keyword how should i do that? When tried with
keywords '-"mountain"' do
minimum_match 1 end
It returned 0 results.
Is there any way that we will pass only negative filter value to sunspot and retrieve all the records except the passed keyword?
Upvotes: 1
Views: 719
Reputation: 27
This seems to be a feature/limitation of solr/sunspot but I have a workaround for this problem.
This will search with conditions (keyword specified AND without the escape string)
Upvotes: 0