A discussion began with Rob_Nicholson pointing out an issue where searching for “wb.camra.org.uk” doesn’t return any results, despite the text existing in a post. codinghorror suspected that the search limit might be the cause, but elijah noted that adding more text to the search query breaks the search.
Further investigation by Rob_Nicholson revealed that searching for website addresses is a common requirement, and DeanMarkTaylor found a relevant fix from 2016 that might be related to the issue.
sam acknowledged the bug and found that the PostgreSQL tokenizer is not correctly handling the search query. After some investigation, sam determined that the issue is likely an implementation bug on Discourse’s side.
The bug has been fixed with a commit to the Discourse repository, and users can resolve the issue by re-indexing affected posts.
Anyone hazard a guess why searching for “wb.camra.org.uk” doesn’t find any posts when that text is most certainly in a post. Whereas a search for “wb.camra” does work.
I would say searching for website addresses is a pretty common requirement as it’s a unique identifier. And yes, it is now repeatable on here. I think people would complain if searching for www.bbc.co.uk didn’t work on Google.
Maybe somebody who knows how the search engine works could comment on what Discourse is doing with the search string? Is it getting processed so that it’s not searching on what one types?
Later… and yes, having included www.bbc.co.uk in this message, Discourse is unable to find it.
searching for camra.org seems to work OK. As does camra.
As to what bits of Postgres innards don’t like camra.org.uk and wb.camra.org and wb.camra.org.uk I can’t say. There is a reason there are tens of thousands of people working at Google, and literally nobody uses Bing even though it air-quotes “works”
Although the file app/models/search_observer.rb doesn’t seem to exist in the current version of the code I assume those fixes are still in there somewhere…