Hey I'm the author of dm-sphinx-adapter.
At the moment you can:
1) Full text search all fields in the index(es) without attribute
conditions using a raw query:
Item.search(:conditions => [%q{search for me}], default_options_hash)
2) Full text search one or more fields or attributes in the index(es)
with optional :default conditions:
Item.search(:field_blah => 'value', :attribute_blah => 'value',
default_options_hash)
See the query tests and DM::A::Sphinx::Query documentation for more
examples of whats possible.
I'd like to be able to express a search across all fields *and* supply
optional attribute conditions (which sounds like what you are asking
for) but I can't see a nice way hook extra logic in before DM's query
construction and validation which happens in shared code in
Model#scoped_query.
I hope the syntax talk that's been going on will allow non DOAs more
flexibility perhaps by passing query conditions through an adapter
hook for query construction? In the meantime I'm open to suggestions,
patches and will freely hand out commit privileges if you can't
possibly wait for me to merge your pull requests :)
Cheers,
Shane.
On Feb 11, 7:45 am, Rolly <[email protected]> wrote:
> Hi,
>
> I've been playing around with dm-sphinx-adapter and dm-is-searchable
> and I was wondering if there's anyway to do full-text queries like:
> Item.search('keywords', options_hash)
>
> Instead of:
> Item.search(attribute_keywords_hash, options_hash)
>
> I guess the first one could just use the same keywords against every
> searchable attribute, but combine them using OR rather than AND.
>
> I've haven't figured whether this is possible yet, has anyone managed
> something like this with dm-sphinx-adapter?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---