Nacho_Caballero is experiencing issues with exact match searches in Discourse. Despite using quotes, search results include matches with similar but not identical words. Initially suspecting accented characters or stop words, Nacho_Caballero has tried modifying the Spanish stopwords dictionary.
To reproduce the issue, tgxworld requested a sample text and search term, which Nacho_Caballero provided. However, the issue only occurs with a large number of posts (around 68K).
Yashi12 inquired about the search algorithm used by Discourse, and Nacho_Caballero assumed it’s the default full-text search Postgres algorithm. Using the ‘simple’ dictionary might provide exact matches without stemming or ignoring stop words.
Overgrow also reported similar issues with exact match searches, and codinghorror suggested using quotation marks to search for exact phrases, but this does not always yield the desired results.
I initially thought it might have something to do with the accented character, but I’ve done several tests and the same thing happens with unaccented characters.
En efecto, no se usa después del “pienso que” porque lo que estás afirmando que piensas, se trata de una realidad, y no de una posibilidad.
Por otro lado, utilizamos subjuntivo cuando utilizamos esta misma estructura, pero en negativo: “No pienso que haya mucha gente en el mercado hoy”.
Espero que esto responda a tu respuesta, pero si necesitas más detalles, por favor dime, y con gusto te ayudaré.
¡Saludos!
However, to reproduce the behavior here, you’d have to set the locale to Spanish and truncate the dictionary
I’ve tested it on a development Discourse site I have running locally and I’m not able to reproduce the behavior, but I think it’s because the site is practically empty. I don’t think this issue comes up until you have a lot of posts (I currently have around 68K).
I could try other things related to the postgres dictionary, but I’m not sure how to enter my docker image when running a development installation. Is there an equivalent to launcher enter app?
Ideally, there would be a way to ignore stop words. For example, to look for this sentence in your message:
I assume Discourse uses the default full-text search Postgres algorithm. I think the only way to provide exact matches when using quotes (without stemming and without ignoring stop words) would be using the ‘simple’ dictionary