Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
This is an API module right ? So I think ıt needs to provide a good and clean documentation about how to use this module API for developers.
I want to see how I can create new facets for my custom query pages created with apache solr module query API. I want to see how can I create my own facets with (I think) hook_facetapi_facet_info from scratch using facet API.
Is there an example about this somewhere on the internet ? Because I couldn't find anything.
Comments
Comment #1
yusufsarac CreditAttribution: yusufsarac commentedComment #2
cpliakas CreditAttribution: cpliakas commentedIt would be helpful to understand what could be more clear in facetapi.api.php, as that is intended to show how to implement the various hooks.
Since you are working through this process and are having a hard time working with the existing documentation, I think you are in a perfect position to help identify the pain points and contribute back what you learned.
Comment #3
yusufsarac CreditAttribution: yusufsarac commentedI'd love to do that. But I'm stuck now because I don't know how to start creating a custom facet block for custom query page.
I mean Facet API uses the default query created by apache ssi or search api modules. What I want is change that to my custom solr query somehow, and make facets for that custom page.
May be you can help me with that for a start and I can go from there and write some tutorials about the api.
Comment #4
marcoka CreditAttribution: marcoka commentedhttp://www.trellon.com/content/blog/apachesolr-and-facetapi
Comment #5
jcfiala CreditAttribution: jcfiala commentedYeah, I agree. I'm trying to create a new facet. I have no idea how a facet, such as the bundle one that comes out of the box with facetapi in the facet module, actually modifies the search query to restrict it to only show the selected bundle(s). I'm trying to figure this out, and there's no documentation.
Basically, if I have a custom entity X, and I have a property on this custom entity, how do I create a facet for that property?
Comment #6
alecsmrekar CreditAttribution: alecsmrekar commented@jcfiala Have you found any documentation on this? I'm also struggling.
Comment #7
botrisCreating a facet for a property on custom entity X (as requested in #5), you need to:
Adding the custom entity to the searcher definitions is done by
hook_facetapi_searcher_info()
Defining the facets is done by
hook_facetapi_facet_info()
Of course the array_merge is optional if you don't want all fields exposed as facets.