[FULLTEXT] How to search for underscore seperated words ?

Friday, 5 June 2020 · 4 messages
EF
ETANCHAUD Fabrice5 Jun 2020 14:38 #
Hi all BaseX users, When I search for 'YET_ANOTHER_SILLY_KEYWORD', ft:search gives me all text nodes containing any of the YET ANOTHER SILLY KEYWORD words. I tried the different search modes, but could not find a way to get ft:search return only the text nodes containing the concatenation. Does anybody have a solution ? Best regards, [MAIF] Fabrice ETANCHAUD Unité Etudes Informatiques - MAIF VIE 50 avenue Salvador Allende 79029 Niort Cedex 9 fabrice.etanchaud at maif.fr MAIF.FR<http://www.maif.fr/> | Retrouvez-nous aussi sur [Facebook] <https://www.facebook.com/MAIFassureur> [Twitter] <https://twitter.com/MAIF> [Youtube] <https://www.youtube.com/user/maif>
BD
Bridger Dyson-Smith5 Jun 2020 18:22 #
Hi Fabrice - Maybe something like ft:search("the-database", "YET_ANOTHER_SILLY_KEYWORD", map { "mode": "phrase", "ordered": true() })? I confess that I don't know the full text module behavior at all, but I coincidentally had it open... Anyway, I hope that's helpful. Best, Bridger
Quoted text · ETANCHAUD Fabrice · 30 lines
On Fri, Jun 5, 2020 at 8:38 AM ETANCHAUD Fabrice <fabrice.etanchaud at maif.fr> wrote: > Hi all BaseX users, > > When I search for 'YET_ANOTHER_SILLY_KEYWORD', ft:search gives me all text > nodes containing any of the YET ANOTHER SILLY KEYWORD words. > I tried the different search modes, but could not find a way to get > ft:search return only the text nodes containing the concatenation. > Does anybody have a solution ? > > Best regards, > > > [image: MAIF] > > *Fabrice ETANCHAUD* > > Unité Etudes Informatiques - MAIF VIE > > 50 avenue Salvador Allende 79029 Niort Cedex 9 > > fabrice.etanchaud at maif.fr > > *MAIF*.FR <http://www.maif.fr/> | Retrouvez-nous aussi sur [image: > Facebook] <https://www.facebook.com/MAIFassureur>[image: Twitter] > <https://twitter.com/MAIF>[image: Youtube] > <https://www.youtube.com/user/maif> > > >
BD
Bridger Dyson-Smith5 Jun 2020 19:31 #
Fabrice - my apologies. I see now that my suggestion was very naive. I hope I didn't waste your time. Sorry for the noise. Best, Bridger
Quoted text · Bridger Dyson-Smith · 44 lines
On Fri, Jun 5, 2020 at 10:23 AM Bridger Dyson-Smith <bdysonsmith at gmail.com> wrote: > Hi Fabrice - > > Maybe something like > ft:search("the-database", "YET_ANOTHER_SILLY_KEYWORD", map { "mode": > "phrase", "ordered": true() })? > > I confess that I don't know the full text module behavior at all, but I > coincidentally had it open... Anyway, I hope that's helpful. > Best, > Bridger > > On Fri, Jun 5, 2020 at 8:38 AM ETANCHAUD Fabrice < > fabrice.etanchaud at maif.fr> wrote: > >> Hi all BaseX users, >> >> When I search for 'YET_ANOTHER_SILLY_KEYWORD', ft:search gives me all >> text nodes containing any of the YET ANOTHER SILLY KEYWORD words. >> I tried the different search modes, but could not find a way to get >> ft:search return only the text nodes containing the concatenation. >> Does anybody have a solution ? >> >> Best regards, >> >> >> [image: MAIF] >> >> *Fabrice ETANCHAUD* >> >> Unité Etudes Informatiques - MAIF VIE >> >> 50 avenue Salvador Allende 79029 Niort Cedex 9 >> >> fabrice.etanchaud at maif.fr >> >> *MAIF*.FR <http://www.maif.fr/> | Retrouvez-nous aussi sur [image: >> Facebook] <https://www.facebook.com/MAIFassureur>[image: Twitter] >> <https://twitter.com/MAIF>[image: Youtube] >> <https://www.youtube.com/user/maif> >> >> >>
LQ
Liam R. E. Quinin reply to ETANCHAUD Fabrice, 5 Jun 2020, 14:385 Jun 2020 20:49 #
Quoted text · ETANCHAUD Fabrice · 5 lines
On Fri, 2020-06-05 at 12:38 +0000, ETANCHAUD Fabrice wrote: > Hi all BaseX users, > > When I search for 'YET_ANOTHER_SILLY_KEYWORD', ft:search gives me all > text nodes containing any of the YET ANOTHER SILLY KEYWORD words.
Does it work to put the phrase in double quotes?
  ft:search(...'"the-phrase_here"'
? Or use, //p[. contains text "the_word_with_underscores"] ? (i've use contains text followed by ft:mark() to do match highlighting) Liam
-- Liam Quin, https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org

⚡Generated with XQuery