Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal 7 Mongo Search Views

I have nodes which are attached to mongo documents.

I want to be able to do the following:

Search the node's title + description + mongo keywords (mongo has a nid field). Any node that matches any of that information is returned in the view. Is this possible with some special view hook? (I can already search the view by description)

like image 951
Chris Muench Avatar asked Oct 24 '22 17:10

Chris Muench


1 Answers

You need to store the node title and body in the mongodb document you want to query as mongodb can't query. If you are not bound to a current structure store the keywods as a multivalue text field and use efq_views. If you can't do that, I once wrote a MongoDB Views backend, you can look at it in http://drupal.org/sandbox/chx/1261486 but it's years old. Really the only challenge is telling MongoDB about the structure of your document but if you are bound to a structure then you don't need to solve that in a generic way.

Edit: As for credible, I am (ok, was) the MongoDB Drupal module maintainer, took part of the design and the initial implementation sprint of field API, was the Drupal architect of a Top 100 website running on Drupal 7 + MongoDB.

like image 171
chx Avatar answered Oct 30 '22 21:10

chx