jasonmk / datastax_rails

A Ruby-on-Rails interface to Datastax Enterprise. Replaces the majority of ActiveRecord functionality.
MIT License
23 stars 9 forks source link

Fulltext :fields support #28

Open davidkelley opened 10 years ago

davidkelley commented 10 years ago

Hi jasonmk, I'd like to be able to search over models using specific fields, although I noticed that in your documentation for the class the :fields option is not yet implemented. Is this still the case?

Happy to do the work for this if you can point me in the right direction :+1:

jasonmk commented 10 years ago

I seem to recall that I never implemented it because I think it requires the disMax parser, and I'm currently defaulting the Lucene parser. It's been a really long time though, so I might be wrong on that. It might be a good time to also investigate using disMax (or eDisMax) as the default.

If you want to take a stab at implementing the fields option, it would be in Relation#query_via_solr. The one thing to keep in mind is that currently, if you pass .fulltext multiple times, they get AND'd together. In this case, the fulltext queries will have to go against the same fields. The Apache wiki appears to be down right now, but there's a page up there somewhere that shows what URL parameters have to be set to specify the fields.

davidkelley commented 10 years ago

Cool, w.r.t. the Lucene and disMax parser I will check this out before I start any implementation, thanks for giving me the heads up on this.