0

I am using Seach API, Solr Search modules in my website for searching. I've created an index, say 'Blogs index', I've selected blogs content type to index Fields - title, body, Author are added to index.

Created the View for the search results.

Issue is when I search the name of the author, I'm getting no relevant results. Result should be the list of blogs written by the searched author.

field Author is an entity reference field referencing the content type 'Blog Author' and is a multi-valued field. Any help is appreciated.

0

I haven't tried this with Search API but if your "Author" is a separate content type and not the actual default Author field you need to add the Relationship for that Entity reference field (for the "Blog Author" content type).

Different Content types store data in different database tables. Relationships introduce that other table data into your Views.

You'll probably have to add the Title field using that Relationship (which is, I presume, your blog author name), and include that field in the Search API settings so it gets searched.

Entity reference fields only store the ID of the referenced entity, so using them alone won't let you search the actual Title field text of the referenced entity. You can only do that through the Relationship and the relevant Title field (or however you named that field).

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.