[Patch] add raw_query to the sunspot dsl
Reported by benjamin | October 15th, 2009 @ 02:15 PM | in Feature Requests
this patch adds basic raw_query option to sunspot, if you want to send a specific query to sunspot.
Comments and changes to this ticket
-

Magnus Bergmark October 19th, 2009 @ 03:31 AM
What would happen if both a keyword and a raw_query is specified at the same time?
-

Magnus Bergmark October 19th, 2009 @ 03:31 AM
- Tag set to feature-request, patch
-

benjamin October 19th, 2009 @ 06:06 AM
Magnus,
that should raise an IllegalSearchError, since you should
know what you're doing when you perform a raw_query search.
good point ..cheers
ben -

-

Magnus Bergmark October 19th, 2009 @ 08:42 AM
- Title changed from add raw_query to the sunspot dsl to [Patch] add raw_query to the sunspot dsl
-

mat October 19th, 2009 @ 09:33 AM
I've given this some more thought, and I think the most flexible thing would actually be to provide a filter to pass the query parameters through before sending them to Solr - that way, you could not only add parameters, but modify existing ones, e.g.:
Sunspot.search(Post) do keywords('some keywords') filter_params do |params| params[:something] = 'foo' params[:q].concat(' AND some_s:value') params end endThoughts? I'd be happy to write the patch, although if someone beats me to it that'd be fine too : )
-

benjamin October 19th, 2009 @ 11:09 AM
as long as this works without keywords or any other dsl-based search, i'm fine ..
not sure if filter_params is a good name .. probably call it search_params or query_params ?
Cheers
Ben -

mat October 19th, 2009 @ 11:18 AM
Yeah, the idea would be to just take whatever params Sunspot is generating, and add to/modify them however you want before they're actually sent to solr.
In the filter_params method name, "filter" is meant as a verb - i.e., you're filtering the params. But it is unclear. What name might capture the fact that params are being filtered, but still be clear?
-

benjamin October 19th, 2009 @ 12:00 PM
how about update_params, you're not filtering, you're setting new values..
-

benjamin October 19th, 2009 @ 03:19 PM
- no changes were found...
-

-

mat October 21st, 2009 @ 11:09 AM
- State changed from new to resolved
Yes, this is actually available in the latest gem build.
-

mat December 27th, 2010 @ 02:28 PM
- Tag changed from feature-request, patch to feature, patch
- Milestone order changed from 0 to 0
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Awesome Solr interaction for Ruby
People watching this ticket
Attachments
Referenced by
-
#34 Add support for multiple queries
By implementing this, it will finally be possible to comb...
-
#34 Add support for multiple queries
Also see my comments on #31 for how one might be able to ...