0
  • Flag - 7.x-3.0-alpha4
  • Search API - 7.x-1.3
  • Solr search - 7.x-1.0-rc2+13-dev
  • Apache Solr - 3.5

I have Flag 3.x working fine in my Solr Views. I am able to flag/unflag correctly. Flag comes with a default 'My Bookmarks' view, that shows the current user what they have flagged at the moment. I basically took that view and recreated it using Solr Views. But I am unable to find the Flags: Node flag relationship to only Include only flagged content by Current User. I believe I am just missing something that is already there, because Flag 3 now uses entities, and relationships are solved for the most part. If someone could shed some light on this so I don't end up writing unnecessary code, I would appreciate it.

1

Forgot the close this a long time ago. Anyway, I wrote a custom module for solr to index some extra data, and a views handler to do what I needed.

  • Can you post your code there? Have you setup the ability to add flag links on Search API views. Thanks – 118218 Nov 7 '13 at 18:01
0

First, the modules Search API Solr Search and Apache Solr are independent. You only need one or the other, and the module Apache Solr Views is only necessary with Apache Solr (the module Search API implements its own Views integration).

Second, integration of flag with Search API views is still in progress in Flag 7.x-3.x, see http://drupal.org/node/1362298 and http://drupal.org/node/1315850. You won't be able to do this without using one of those patches or waiting for them to be included in a release of the Flag module, I'm afraid.

  • I never said I was Using Search Api Solr and Apache Solr Integration together. And I never said anything the about Apache Solr Views module. – picxelplay May 6 '13 at 20:12
0

To filter content that were not flagged by a user, I added a PHP Global field under the "Filter" section in views and added the following code:

$flag = flag_get_flag('bookmarks');
if ( $flag->is_flagged($data->entity, $GLOBAL['user']->uid) ) { 
  return FALSE;
} else {
  return TRUE;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.