Today I wanted to add a computed field to my facet to make a faceted search using that field but when checking the facets page that field wasn't in the allowed field to make facets. When i realized none of my computed fields was in that list i came to the conclusion that you can't use computed fields as facets.
Looking on google didn't help me confirm my dobuts, there's actually no result that talks about solr facets and computed fields so i decided to ask here:

Can you use computed fields to make facets? If yes, is there something i have ti do (install a module, change a setting...) to enable this since at the moment i can't see them from the available facets?

  • 1
    probably not without back-bending or back-breaking effort. Apache-Solr is 1 search service or API. a Computed Field is just that ... 1 computed field stored in its own location. These are 2 separate storage mechanism and how you would meld the 2 into 1 search query is as straightforward to me as it is to you. You may be able to edit the Solr search index to include the field, their have been answered questions already on how to add a drupal field into the apache solr search index already. Google that.
    – tenken
    Dec 17, 2014 at 23:23

1 Answer 1

  • I think you need to store the computed field in database in order to make apache solr index it.

  • There is check box in computed field to save it to database: Store value in database

Just enable it and see if it works.

enter image description here

  • Hi thanks for your answer. I have tried but it didn't work. I have tried with a varchar field and an int field, i have checked that data with that field was indexed on solr. But still it didn't show on the available facets
    – valepu
    Dec 19, 2014 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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