facet and search api
DESCRIPTION
This presentation introduces Drupal 7 developers to Facets, and Search API.TRANSCRIPT
![Page 1: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/1.jpg)
![Page 2: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/2.jpg)
WHAT IS A FACET?
facet of a brilliant diamond of issues. facet joint injections. faceted beads make a statement of a high society look. facets of modern life, the internet has touched forensic science. We'll have two days to explore the many facets of this small island. facet publishing is the leading international publisher of books for
the library and information profession.
faceted classification, search and navigation application, waypoint, is transforming the way users find information.
![Page 3: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/3.jpg)
WHY DO YOU NEED IT?
If you have a lot of data which needs to be searched or the main function of your site is finding data via a search. The Faceted Search module provides a search API and a search interface which allows users to rapidly browse the site’s content. The search interface also provides a information navigation/discovery tool (something similar to breadcrumbs). The Facet function will create an index(s) for all requested search data. With it, you will also generate a index access or facet block for each indexed item.
![Page 4: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/4.jpg)
You need the following modules:
• https://drupal.org/project/facetapi • https://drupal.org/project/search_api • https://drupal.org/project/search_api_db • https://drupal.org/project/entity • https://drupal.org/project/ctools • https://drupal.org/project/views
![Page 5: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/5.jpg)
See the following: http://beautiful7mind.wordpress.com/2013/03/10/
step-by-step-how-to-implement-facet-search-on-data-in-drupal-7/
http://envisioninteractive.com/drupal/drupal-7-views-with-faceted-filters-without-apachesolr/
http://munich2012.drupal.org/program/sessions/building-amazing-searches-search-api-and-facet-api.html
![Page 6: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/6.jpg)
![Page 7: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/7.jpg)
The following informational message is displayed after the Search API was enabled
After selecting all the needed modules, click the “Save” configuration. If your module page does not look like this one, then you need to download and enable “module filter”.
![Page 8: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/8.jpg)
Before setting up the ‘search’ facets, you need to setup your “content type” to have the taxonomy terms or items that will be indexed. Be sure that there is data available to setup the facets (I used the “devel” to generate my data).
![Page 9: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/9.jpg)
Next you need to set up a server to process the data by accessing the “Search API” interface via Configuration -> Search and metadata then click “Add server” to add a server. You can set up as many servers as required. One for your local site (to use a Database server) and one for the production site (to use a Solr server).
![Page 10: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/10.jpg)
Here you will define the server name and then select a “Service class”. This is defined by module “search_api_db” for the database services.
![Page 11: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/11.jpg)
After clicking the “create server” button this confirmation page is displayed.
![Page 12: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/12.jpg)
Return back to the “Search API” configuration page to configure the setting for the index the site’s data. The Index has five different configuration/status pages to use in setting up the different facets to search the data.
![Page 13: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/13.jpg)
First use the setting’s page to set which server to use. These are defined by the server created in a previous step.
![Page 14: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/14.jpg)
Select the “Fields” Tab to add the fields needed in the search. Use the “Add Related Fields” at the bottom of the page to add your Taxonomy Fields
Once they have been added you can select them to be part of the index
![Page 15: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/15.jpg)
You will need to “enable” the index on the “Status” page. Click the “enable” button to have it available.
![Page 16: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/16.jpg)
![Page 17: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/17.jpg)
Now the “Facets” need to be defined in the “Facets Tab”. Select the needed data and “Save configuration”. Once save the Administration message is displayed
![Page 18: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/18.jpg)
Here you define the facet blocks you want and well as you have three different “Facet” configurations available and the ability to export the configurations
![Page 19: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/19.jpg)
Before the searches will work you must index the data, so go back to the status tab and click on the “Index now” button.
![Page 20: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/20.jpg)
Now that the “Facets” have been created, the index blocks are available go to Structure -> blocks and scroll to the bottom portion of the page and place the blocks in a region for display.
![Page 21: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/21.jpg)
Now enable “views” so you can display the data
![Page 22: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/22.jpg)
To set-up a view to see the data go to Structure -> Views, then click on the “+ Add new view”. After naming, selecting the what to show and the Display Format, then click on “Continue & edit”.
![Page 23: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/23.jpg)
Now to configure the view to display the appropriate data. You can add the required fields by clicking on the “Add” next to the FIELDS area. Select all the required data to be displayed, set the page url, set the menu information and then click on the “Save” button in the upper right corner. You will see a preview of the view in the lower portion of the page.
![Page 24: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/24.jpg)
Display output of the Test view page along with the Facet blocks.
![Page 25: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/25.jpg)
Now to see the Facet block in action….
![Page 26: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/26.jpg)
Output after clicking on the “Author” bicaje
![Page 27: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/27.jpg)
To add the search capability to the view you need to add filters and make then exposed the user.
![Page 28: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/28.jpg)
Now you have a search function for the site which will use the indexes/facets that were created
![Page 29: Facet and Search API](https://reader033.vdocuments.mx/reader033/viewer/2022051609/5463a1b1b4af9f623f8b45f1/html5/thumbnails/29.jpg)
Any questions???
Thank you for listening…