Vengono ignorati termini specifici nelle ricerche?

I’m having a few difficulties with the search functionality today.

We have an automated process we creates topics based on a lecture from a course, an example may be;

About ‘Implementing Health & Damage’

I found myself wanting to reduces the maximum number of characters for a topic length and decide I’d do a quick search to see how many of our automated topics are quite long, to get a feel for the suitable max length.

If I search using the above, I’ll get result, but I need the search to be a little more general than that, so I’ve tried searching for;

About ’

…knowing that is the start of the format we always use. When I do, I don’t get any results, if I add another word after the apostrophe I do get results. I assumed at that point it was related to the apostrophe, but nope, if I search for just;

About

I get no results, yet if I search for;

Test

I do get results! This indicates there isn’t a limitation on the number of words as a minimum for a search, and we have a 3 character limit set for the term, so it isn’t that. The only thing I can think of is that there is a list of “words” that are being ignored from a search, yet I don’t think we’ve set these up.

Any information would be appreciated. :slight_smile:


Update

I have also tested this with “because”, “and”, “the” and these all produce no results, so I’m feeling that there is a list of “common words” which are being ignored, but because I don’t have access to these via the settings I cannot alter them, and, cannot perform the search I want to perform.

Yes, I believe these are “stop” words — see:

I’m not sure if things have changed much since two years ago, but there doesn’t seem to be an easy way to change those.

8 Mi Piace

Hi Kris,

Thanks for the reply.

Yeah, I thought as much. It’s a pain on this occasion as in this specific case the word does have value.

I guess using DataExplorer wouldn’t get around this either?


Update

Actually, via DataExplorer it works. I guess a full text search isn’t carried out when querying the topic title field.

Looks like a work-around :slight_smile:

7 Mi Piace

Mi sono imbattuto anche io in questo. È… estremamente fastidioso. Ci sono aggiornamenti? Esiste un modo per modificare questa situazione ora? “About” non dovrebbe assolutamente essere una parola filtrata per la ricerca! Ecco come mi sono imbattuto in questo qui su Meta:

Ero nella categoria Plugin e ho notato che alcuni argomenti sui plugin eliminano automaticamente le risposte, mentre altri no. Così sono andato a vedere se c’era una spiegazione a riguardo nell’argomento “About” di quella categoria. Non c’era, quindi stavo per chiedere, ma volevo prima fare una richiesta di funzionalità a un plugin (in un argomento che elimina automaticamente le risposte :grinning_face_with_smiling_eyes:). Così sono tornato alla lista principale delle categorie e ho pubblicato la mia risposta. Poi sono tornato di nuovo alla lista delle categorie e ho cercato l’argomento About the Plugin category. Dato che era un argomento più vecchio ma fissato in alto, e l’avevo già letto… non era più visibile nella lista (era stato spostato nella posizione corrispondente alla sua data). :roll_eyes: Ok, nessun problema, farò una ricerca… Ma naturalmente, niente da fare.

Il problema maggiore è che non c’è assolutamente alcun avviso o messaggio nell’interfaccia utente a riguardo. La ricerca fallisce semplicemente in silenzio. Quindi, se questo è irrisolvibile a causa delle limitazioni di Postgres, suggerirei vivamente di aggiungere una funzionalità in Discourse che notifichi agli utenti che queste parole vengono filtrate dalla ricerca! Altrimenti è piuttosto confuso.

1 Mi Piace

Sono anche sorpreso che “about” sia nella lista attuale delle parole vuote di Postgres, ma eccola qui:

Un’alternativa è cercare argomenti fissati in una categoria

in:pinned #support

1 Mi Piace

Grazie Jeff, non sapevo che si potessero cercare gli argomenti fissati. C’è sempre qualcosa di nuovo e interessante da scoprire nelle funzionalità di Discourse. :smiley:

Ma… hai qualche idea su come avvisare il povero utente che cerca e non trova nulla, anche quando sa che ci dovrebbero essere risultati? Ora che vedo l’elenco completo, è davvero piuttosto lungo…

2 Mi Piace

È una buona idea emettere un avviso se la tua ricerca contiene solo parole di arresto. Quanto sarebbe difficile farlo @tgxworld?

Non vogliamo hardcodare l’elenco, quindi abbiamo bisogno di un modo per interrogare Postgres e chiedergli: “tutte queste parole sono parole di arresto?”

3 Mi Piace

Possiamo restituire una colonna aggiuntiva nella nostra query di ricerca che ci permetta di capire se il termine è composto solo da parole vuote, cosa che non è molto difficile da realizzare. Dovrò scavare più a fondo per capire dove inserire quella colonna aggiuntiva, ma l’obiettivo finale per noi dovrebbe essere evitare una query DB extra solo per determinare se un termine è composto interamente da parole vuote.

2 Mi Piace

Forse, se non ci sono risultati di ricerca, possiamo eseguire quel controllo per verificare se la query contiene solo parole vuote? In questo modo, eseguiremo un controllo aggiuntivo solo quando i risultati sono comunque scarsi. Secondo l’elenco delle parole vuote, ad esempio, se cerchi “doing should now”.

Nel caso peggiore, potremmo duplicare l’elenco ed eseguire il controllo lato server; si tratta di sole 127 stringhe, ma sarebbe una soluzione poco elegante. Forse all’avvio potremmo interrogare l’elenco delle parole vuote e memorizzarlo nella cache?

2 Mi Piace

Sì, è un po’ simile a quello che intendevo con la colonna aggiuntiva nei risultati di ricerca. Se la ricerca è vuota, controlliamo la colonna per capire se è perché tutti i termini sono parole vuote o perché abbiamo ottenuto 0 corrispondenze.

2 Mi Piace

Come funzionano queste stop words in altre lingue? Anche quelle tradotte vengono fermate? O solo quelle inglesi quando sono collegate a esigenze tecniche?

Ci sono file per diverse lingue

2 Mi Piace

Capisco. Quasi tutti i pronomi personali in quasi tutte le forme, e con il verbo essere, più alcuni riempitivi come or, only, when ecc. Quasi tutto può essere aggirato nelle ricerche, per esempio non abbiamo per lo più bisogno di persone in una frase. Ma certo, mantiene il database più controllabile.

Ma è bene sapere che è stato costruito anche per lingua. Grazie.

2 Mi Piace