I’m trying to develop a basic plugin for fully integrating WP e-Commerce and Relevanssi, and a feature currently missing that’d make that possible would be a filter within
relevanssi_index_docfunction to add custom contents to a posts index.
That’s because WPEC has products (let’s say, “shirt”), which are a custom post type, as well as variations of a product (for example, “white”, “red”, “big”, “small” etc.), each of which is itself a custom post too, but which shouldn’t be accessed directly. So, while the
relevanssi_post_okfilter allows me to make sure those variations don’t appear in the search results, there’s currently no direct way for me to make terms specific to the variations become “part” of the main product indexed so that ‘AND’ searching for, let’s say, “red shirt” will find the “shirt” product, or place it above other shirts which don’t have “red” in their text when ‘OR’ searching.
So, my suggestion is for something like this to be added at line 2334 (i.e., at the content level, after custom fields, and before the excerpt):
// Allows plugins to add content to a post's index. Must return a string. $post->post_content .= ' ' . apply_filters('relevanssi_index_content', $post);
What do you think?
By the way: I’m not using product tags, but I noticed product categories don’t seem to be indexed in Relevanssi, so it’s probably the case that WPEC is using something non-standard for its categories and hence that a similar
relevanssi_index_taxonomyfilter would be needed to make it work. Once I’ve figured the best place (and way) to have it added I’ll post an updated suggestion here. 🙂
- The topic ‘[Plugin: Relevanssi – A Better Search] Feature Request: "Index content" filter’ is closed to new replies.