Activating Boosts removes some products from search
-
sraggioParticipant3 months, 2 weeks ago #59324
I’ve just activated Boosts to give more weight to the Title field, and found that there are a number of products, including some that have the search term in the title, that are not being displayed in search. For example, with Boosts deactivated, I see the same number of results both in the WP admin Products search and the public web page search. However, activating Boosts, the number displayed on the public page drops. I have not selected “copy to a text field” for any field in Boosts. Any idea what could cause certain products to be ignored or skipped with Boosts activated?
wpsolrKeymaster3 months, 2 weeks ago #59327By default, the search indexes titles, content, custom fields, and taxonomies. To make a fair comparison, you should configure the same fields, boosts, and “Copy to Text Field” settings.
Also, keep in mind that the query parser may rewrite or expand the search query differently, which can affect both relevance and the number of results returned.
sraggioParticipant3 months, 2 weeks ago #59335I’ve assigned a boost factor to every field listed in 2.3 Boosts, and set “copy to text field” on all where it’s an option. However, I’m still seeing a disparity comparing public site searches to searches in the admin product listings. For one test search term, 107 vs 95; another 200 vs 179. When I track down the products missing from the public search, most contain the search term in the title, which I have assigned the highest boost factor to.
wpsolrKeymaster3 months, 2 weeks ago #59336You can display the queries with our Query monitor add-on and play with them inside Kibana.
sraggioParticipant3 months, 2 weeks ago #59339After some AI troubleshooting, this is Claude’s conclusion:
Your title field is type text_lws — and that “_lws” is almost certainly a whitespace + lowercase analyzer with no punctuation handling. The catch-all your non-boosted search hits (_text_, type text_general, StandardTokenizer) strips punctuation; text_lws does not. That’s the entire bug. When boost is off you query the punctuation-stripped catch-all (everything matches); when boost is on WPSolr queries the individual text_lws fields by name, and every punctuation-glued occurrence drops out.sraggioParticipant3 months, 2 weeks ago #59342Is this by design in WPSolr? Claude is recommending that I change schema.xml, to add the following filter to the text_lws type:
<charFilter class=”solr.PatternReplaceCharFilterFactory” pattern=”[,;:()\[\]{}]” replacement=” “/>
so that the search, with Boost activated, will properly return instances of the search term with punctuation attached.wpsolrKeymaster3 months, 1 week ago #59343The
titlefield is currently defined as a simple field using only a lowercase filter. In the standard (non-boosted) search, its content is copied into thetextfield, which uses an English analyzer.If you’d like the
titlefield itself to benefit from the same analysis, you can edit yourschema.xmland change its type fromtext_lwstotext, then restart the core and reindex all your data:<field name="title" type="text" indexed="true" stored="true"/>This will make the
titlefield use the English analyzer directly instead of only applying lowercase filtering.
You must be logged in to reply to this topic.