Extended Search for HivePress

Hey @everyone,

If you run a HivePress site, you may have noticed the keyword search only really looks at listing titles and descriptions. It quietly skips a couple of places that often hold the exact keywords a user is searching for: the names and descriptions of Marketplace pricing tiers your vendors write, plus your listing category names and descriptions.

I’ve been playing around with AI again and built a small (single-file, free) plugin to fix that. It extends the native HivePress search so a keyword also matches:

  • Pricing tier names and descriptions (for anyone on HivePress Marketplace with pricing tiers switched on)
  • Listing category names and descriptions
  • Sub-categories, so searching a broad category like “Grooming” also surfaces listings filed under its children like “Nail Clipping” or “Bathing”

Grab it here:

A few notes:

  1. Install and activate it alongside HivePress. The pricing tier matching also needs HivePress Marketplace with the “Allow sellers to set pricing tiers” option enabled in your HivePress settings.
  2. That’s it, nothing to configure. It hooks into the existing search form, so there are no template changes to make.
  3. On first activation it quietly indexes your existing listings in the background (spread across a few admin page loads), then keeps itself up to date whenever a listing is saved.
  4. It leaves the rest of your search alone and won’t throw up duplicate results when a listing sits in more than one category.

Warning: I built this with a lot of AI help and it’s working perfectly on my own site, but please test it on a staging copy before putting it live, just to be safe. If you hit any snags or have ideas, I’d love to hear them! :slight_smile:

I feel this could benefit the majority of HivePress-powered site owners, and think it could make another great addition to the core.

Cheers,
Chris :victory_hand:

P.S. If this extension saved you time or money, consider buying me a coffee! Sharing these tools for free takes a lot of time and resources, and your support helps me keep doing it for the community. Thank you! :hot_beverage:

2 Likes

Hi @ChrisB,

Thanks a ton for sharing it! It sounds great, and we will also consider expanding the search functionality to include more entities.

P.S. It seems like you had a productive weekend with HivePress :slightly_smiling_face:

1 Like

Hey @kseniia,

My pleasure! So glad you guys like the sound of it, too.

Haha, indeed - I guess I just like putting an overactive imagination to good use! :laughing:

Cheers,
Chris :victory_hand:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

v1.4.0 - Plugin Update Notes

New

  • Automatic updates - new versions now appear on your Plugins screen like any other plugin, with the release notes in the details popup. This is the last time you will need to install it by hand.

  • Translatable - the plugin now ships a language file, so Loco Translate can pair with it.

  • A notice when HivePress is missing - it used to sit there doing nothing with no explanation.

  • Donate link - a quiet link on the Plugins screen, for anyone who would like to support the work. It gates nothing.

Changed

  • Stated requirements - the plugin now declares the WordPress and PHP versions it needs, and HivePress as a required plugin, so you are warned before activating rather than after.

Nothing about how the search behaves has changed.

This one release has to be installed by hand, because the version you have has no updater to offer it. Download the .zip, then upload it under Plugins, Add New, Upload Plugin. Every release after this one will arrive on your dashboard by itself.

Cheers,
Chris :v:

Hi @ChrisB,

I’ve merged the topics. The Development category doesn’t automatically close topics 30 days after the last reply. However, since this topic was previously in the General category, that rule applied to it.

I’ve reopened the topic so you’ll be able to post updates whenever needed.

1 Like

Thank you so much, @kseniia :smiley:

Hope you’re having a good day!

Cheers,
Chris :victory_hand:

1 Like

v1.5.1 - Plugin Update Notes

New

  • Custom Attributes - every text field a seller can fill in, on the listing form and on the profile form, is now matched by the keyword search. Whatever you have named yours, they are covered.

  • Seller Profiles - a word someone wrote in their profile now finds their listings.

  • Tags and Drop-downs - tag names, and any drop-down or checkbox attribute, now match alongside categories.

Changed

  • A New Name - this is now Extended Search for HivePress. Same folder, same settings, and updates carry on as normal.

  • Nothing to Set Up - your existing listings and profiles are indexed for you over the next few admin page loads.


FAQ

  • Which of my fields does it actually search?

Everything a vendor can fill in. Under both Listings > Attributes and Vendors > Attributes, any attribute whose Field Type is Text or Textarea is searched, along with Select, Radio Buttons and Checkboxes attributes, which are matched on their option names. Categories and Tags are matched on both name and description, and a keyword matching a parent category also returns listings filed under its sub-categories. Pricing tier names and descriptions are covered too, if you use HivePress Marketplace.

You do not list any of this anywhere. The plugin reads your own attributes, so whatever you have named yours, they are covered.

  • Do I still need to tick “Indexable” on my attributes?

No. “Indexable” is HivePress’s own checkbox, in the Search section of an attribute, captioned “Include in keyword search”. It does work, but only for listings saved after you tick it, and it cannot reach anything on the vendor’s profile. This plugin covers the same attributes whether that box is ticked or not, and it indexes your existing listings for you.

Leaving it ticked does no harm, so there is nothing to undo.

  • Do I need to re-save all my listings?

No. The plugin works through your listings and vendors 100 at a time as you move around wp-admin, so even a large site catches up over a few page loads. From then on, saving a listing or a profile re-indexes it straight away.

  • Why does a word from a vendor’s “About Me” return all of their listings?

Because it describes all of them. A vendor who writes “twenty years of bridal work” on their profile is telling you something that is true of everything they offer, so a search for “bridal” returns their listings.

  • Can it search phone numbers, email addresses or the Location field?

Not by default. Those are contact and address details rather than the sort of thing a visitor types into the Keywords box, so they are left out to keep results relevant.

If you do want them, add this snippet to your site, either through the Code Snippets plugin or in your child theme’s functions.php. Keep only the lines you want and delete the rest:

add_filter(
	'hivepress/v1/extended_search/index_field_types',
	function( $types ) {

		// The Location field, so town and address text is matched.
		$types[] = 'location';

		// Phone Number attributes.
		$types[] = 'phone';

		// Email Address attributes.
		$types[] = 'email';

		// Website and social link attributes.
		$types[] = 'url';

		return $types;
	}
);

That covers every matching attribute on both Listings > Attributes and Vendors > Attributes, and as always only the ones a vendor can actually fill in.

Listings saved after you add the snippet pick it up straight away. To apply it to the listings you already have, go to Plugins and click Rebuild search index on the Extended Search for HivePress row. It works through everything 100 at a time over the next few page loads, and searching carries on working while it runs.

  • What else is left out, and why?

Number, Date and Time attributes, prices, ratings, coordinates and file uploads, because none of them hold words anyone searches for. Regions are left out as well, since a region such as “England” would match every listing on the site and bury the results you actually wanted. Your admin Listings screen is untouched too, so searching there behaves exactly as it always has.


Update via your dashboard as usual! :slight_smile:

Cheers,
Chris :v: