About Book Search

Book Search Demo

The Book Search page uses Site Search ONE WordPress Plugin (beta)

Site Search ONE WordPress Plugin creates a search page in your default layout, it was edited in the WordPress Block editor to add a column containing a Paragraph block alongside the Shortcode block.

It demonstrates how WordPress Custom Fields can be used to filter search results.

This demo returns all book pages by default; you could enter a search manually to narrow the search like ‚Ästpublished contains 1591¬†to find all books first published in 1591, but it is generally quicker to click on the Fields Filter button (1), enter 1591 in the Year Published field, then click¬†Apply!

This image has an empty alt attribute; its file name is search-bar-filter-shadow.png

The Book Search demo has several Custom Fields:

  • Act¬†(try 1, 2 or 3)
  • Scene¬†(try 1,2 or 3)
  • Genre¬†(comedies, tragedies, histories)
  • Title¬†(e.g.¬†king¬†will limit the search to the King Henry 6th play)
  • Year Published¬†(currently the demo plays have published years of 1591, 1594, 1597 only)
  • Author¬†(Shakespeare. Not included in the filter drop down since all the plays are by Shakespeare; a search of¬†author contains shakespeare¬†will return all results)
  • Published¬†(Date Range) The date the Page was published; for this demo they were made the same as the Year Published Custom Field.

Other Search Features

Stemming is on by default so that a search for officer for example will find pages with officers or office also, you can also apply stemming to a single word by appending a tilde like this  officer~  matches officer, officers, office

Synonyms uses the Wordnet Thesaurus, if you apply this option, a search on  petty will find pages with  little  or  small  for example. To apply synonyms to a single word append an ampersand (&) like this little&

Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English. It also useful if you are not sure of the spelling of a word, but will give a very broad search and may return unrelated words. Example #antifolas will find pages mentioning Antipholus.

How to…

Make a Book Search page like this

  • Add your book content to Pages, keep each page short so that they load quickly
  • Enter Custom Field names and Values on each page for example Title, Author, Genre, Published (year), Act, Scene, Chapter, PageNo;
  • Install the Site Search One Plugin, create a Search Page called Book Search and choose to index Pages
  • Select the pages to include
  • Click on the Options button and select the custom fields you want to appear when the user selects the Filter option
  • Select Pages > All Pages and sort by date to find the Book Search page, use Quick Edit to change the template if the default template in not suitable
  • From WordPress Admin > Appearance > Menu add the Book Search page to a menu