2

I have a custom field I have added to my search index, and I have confirmed that there is data being indexed there, and I can query against it in a view using my global index. But when I add the custom field as a display field, the field doesn't render.

I'm noticing the same behavior when I add the urls with the AddURL processor.

I can see the fields are there, and I can query against them with filters, but when added to a view as a field, they won't display.

I noticed that if I go into SearchApiQuery.php on line 527 and change this:

foreach ($result->getFields(FALSE) as $field_id => $field) {

to this

foreach ($result->getFields() as $field_id => $field) {

Then the view displays the results, but it also causes a lot of lag, and is obviously a hack I don't want to do.

What am I doing wrong? Why can't I display a custom solr indexed field in a view?

2

It took a while, but I figured the issue out.

You have to set your solr server configuration within Drupal to return fields at /admin/config/search/search-api/server/

Here's the text on that settings page:

retrieve indexed fields from solr

"Retrieve result data from Solr: When checked, result data will be retrieved directly from the Solr server. This might make item loads unnecessary. Only indexed fields can be retrieved. Note also that the returned field data might not always be correct, due to preprocessing and caching issues."

Basically, if you want to pull data directly out of solr, you have to have this checked. I don't think you can do this at the view level.

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.