By geraud on
Hi,
I have a Drupal 7 install with apachesolr module.
Everything works fine except 2 things:
1. Some of my content types have node reference fields.
Titles of those referenced nodes appear in the excerpts of Solr search results.
I don't want them to show up.
Is it possible to exclude some fields (node references in this case) from being indexed by Apache Solr ? Or better, being indexed but not showing up in excerpts ?
2. I have a local version of my site running on my Mac (MAMP with local Solr server).
Keyword highlighting works great.
But when running on the server (with Solr running on Tomcat), keywords are not highlighted anymore.
Any help would be appreciated.
Cheers
Geraud
Comments
No idea ?
No idea ?
Excluding individual fields from Solr index
I've just had to do something similar myself. To exclude individual fields from being indexed you need to enable the custom node view 'seach index' and then configure it so that the nodes you do not want indexed are excluded from that view.
* Go to /admin/structure/types/list
* For a content type, select 'manage display'
* Expand the 'Custom display settings' fieldset
* Check the 'Search index' option and save
* Note that there's a new node view listed at the top of the page 'Search index', select it
* Move the fields that you do not want indexed under 'Hidden'
* Reindex your content
* Done!
Hope this helps.
Alex
Very usefull (thanks) but ...
Would you by any chance have a clue about excluding Taxonomy Terms fields from the index ? Can't find any doc about this.
I've not had to do that
I've not had to do that myself.
Saying that, you may want to take a look at providing your own "document callback" to be able to create your own structure of Solr index document that excludes the taxonomy term fields.
As I say, I've not had to do that and it might be overkill, there could be an easier way to achieve what you want.
Excellent
This solution worked for me. Thanks
This solution did not work
This solution did not work for me for some reason. I followed all the steps
Are you sure? There is no
Are you sure? There is no reason it shouldn't work. Go back and double check that you did everything correctly, particularly the part about re-indexing (you'll need to delete the current index).
Contact me to contract me for D7 -> D10/11 migrations.