2

We have a problem with search only indexing fields that have their "Field visibility and permissions" either set to be "Public" or "Custom" with the anonymous user able to view. Any field that is private or has some other custom setting isn't indexed.

I only use Drupal occasionally so I'm far from an expert but as far as I can tell reading around, search should index everything except if it's explicitly told not to.

I've searched around and can't find any setting that would seem to be causing it to behave in this way.

Have I misunderstood how it should behave or is there a setting somewhere I'm missing?

cheers, Gordon

EDIT: I realise that I should have specified that the site is using the Field Permissions module to set the permissions on each of the fields.

2
  • 1
    Note that the built in search in Drupal is pretty bad. If you need a very robust search then you should use Apache SOLR. They use it even on Drupal.org
    – Brady
    Dec 5, 2014 at 12:06
  • Thanks for the suggestion. To be honest, the built in search would probably be fine if it indexed all the fields rather than just some of them.
    – cowtan
    Dec 5, 2014 at 17:22

1 Answer 1

0

Drupal renders a node and passes it to indexer. So whatever you see publicly that what is indexed.

but there are few options you can fix that:

  1. to render a node for indexing this is called: $build = node_view($node, 'search_index'); view mode is search_index, so in your node template you can check what view mode it is and render it differently.

  2. you can use display suite module and then use this display "Search result highlighting input" to configure what is indexed

  3. after node is rendered this hook is called $extra = module_invoke_all('node_update_index', $node); you could implement it and return extra information

hope it helps

7
  • Thanks Mantas, I appreciate the suggestions. Like I said in my original posting, I'm only an occasional Drupal user. I tried installing the display suite module but I couldn't what I should do to actually make it do what I want and I couldn't see anything matching "Search result highlighting input". If you could say a bit more about this, that would be great.
    – cowtan
    Dec 12, 2014 at 15:17
  • you go to your content type display settings: for example: admin/structure/types/manage/page/display and there at the bottom is "Custom display settings" check "Search index". Save. then it should appear at the top and you can select it and configure Dec 12, 2014 at 17:56
  • Apologies. Still not getting it. I've gone to the right page, checked "Search index" and clicked Save but then I'm not seeing a display option called "Search result highlighting input".
    – cowtan
    Dec 15, 2014 at 17:30
  • then what do u see Dec 16, 2014 at 16:51
  • Here's a screenshot - img42.com/dwcks
    – cowtan
    Dec 17, 2014 at 17:40

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.