Open felipeelia opened 3 years ago
Thanks Felipe.
For added clarification, in the given example the results for "Dental Real Estate Purchases" are "people" Posts and are mainly associated with dentistry; not Real Estate. So when they appear at the top of a search for "Real Estate" the results are inaccurately ranking higher than other posts more relevant to the Real Estate concept itself.
To avoid this issue we'll have to make some changes to the plugin:
terms.ep_custom_result.name
should be treated differently, just accepting exact matches.In the meantime, this is a way to work around it:
CSRs rely on a taxonomy called ep_custom_result
, so every new CSR is a term of that taxonomy, and posts are added to that term. So, first, it'll be needed to disable the \Feature\SearchOrdering::filter_weighting_configuration()
method, so EP won't use the term field in its search. Then hook a new function to posts_results
, to manually add all posts in that term to the search results.
Thanks again for bringing it up @airportjule! And feel free to share anything you think will be helpful for future users having the same issue.
Does this workaround limit only CSR terms from affecting search results, or disable all weighting configuration?
Describe the bug
If a user has two different Custom Search Results and one is a substring of the other, results in the smaller one will appear in the longest one.
Example: "Dental Real Estate Purchases" and "Real Estate". While searching for "Real Estate", the results added to "Dental Real Estate Purchases" will show up as "Real Estate" matches the search term.
Steps to Reproduce
Expected behavior
Should the results added to one CSR be displayed in another one?