Re: Question for SynonymQuery

2023-01-27 Thread Mikhail Khludnev
Right. SynonymMap.html#WORD_SEPARATOR was a redundant complication. Spaces work fine. On Thu, Jan 19, 2023 at 4:26 AM Anh Dũng Bùi wrote: > Thanks Mikhail! > > It turns out

Re: Question for SynonymQuery

2023-01-27 Thread Mikhail Khludnev
Hello, Santam. It seems I achieved what you asking for. https://github.com/mkhludnev/likely/blob/381b491d25e4d2035dd5b8a891dfdcfe2b986b90/src/test/java/org/apache/lucene/playground/TestMultiPulty.java#L32 It expands API and UI into phrases, which match like you expect. On Fri, Jan 20, 2023 at 4:18

Re: Question for SynonymQuery

2023-01-20 Thread _ SATNAM
Hey Mikhail and Anh Dung Bui i am also struggling with synonym query my use case for eg I created synonyms for word API --> Application program interface UI -> user interface doc 1 ---> This is API and it is called Application program interface doc2 > How i help you in UI thing

Re: Question for SynonymQuery

2023-01-18 Thread Anh Dũng Bùi
Thanks Mikhail! It turns out I used FlattenGraphFilter and cause the PositionLength to be all 1 and resulted in the behavior above =) A side note is that we don't need to use WORD_SEPARATOR in the synonym file. SynonymMap.Parser.analyze would tokenize and append the separator for us. Regards, An

RE: Question for SynonymQuery

2023-01-03 Thread Trevor Nicholls
nuary 2023 09:55 To: java-user@lucene.apache.org Subject: Re: Question for SynonymQuery Hello Trevor. Can you help me better understand this approach? If we have a text "wifi router" and inject "internet device" at indexing time, terms reside at the same positions. How to avoid fals

Re: Question for SynonymQuery

2023-01-02 Thread Michael Wechner
r SynonymQuery; I have just used the standard QueryParser. Instead the synonym processing occurs in the indexing phase, which is not only simpler (one search pattern, one query), but also I think you would also find it gives you superior performance (because the synonym processing occurs once at indexing

Re: Question for SynonymQuery

2023-01-02 Thread Mikhail Khludnev
during searching - and I'm sure you'll be doing far more > searching than indexing). > > cheers > T > > > -Original Message- > From: Michael Wechner > Sent: Thursday, 29 December 2022 08:56 > To: java-user@lucene.apache.org > Subject: Re: Question for

RE: Question for SynonymQuery

2023-01-02 Thread Trevor Nicholls
ing). cheers T -Original Message- From: Michael Wechner Sent: Thursday, 29 December 2022 08:56 To: java-user@lucene.apache.org Subject: Re: Question for SynonymQuery Hi Anh The following Stackoverflow link might help https://stackoverflow.com/questions/73240494/can-someone-assist-me-with-a-mul

Re: Question for SynonymQuery

2023-01-01 Thread Mikhail Khludnev
Hello Anh, I was intrigued by your question. And I managed it to work somehow. see https://github.com/mkhludnev/likely/blob/eval-mulyw-syns/src/test/java/org/apache/lucene/playground/TestMultiPulty.java Beware, synonym files https://github.com/mkhludnev/likely/blob/eval-mulyw-syns/src/test/resource

Re: Question for SynonymQuery

2022-12-28 Thread Anh Dũng Bùi
Thanks everyone for the insight. I guess I'll use BooleanQuery then. There is also a caveat I noticed (not sure if it's an issue or not), which is slightly different from the mentioned thread. When I have a multi-word synonym, let say "wifi router" and "internet device". Then using SynonymGraphFil

Re: Question for SynonymQuery

2022-12-28 Thread Michael Wechner
Hi Anh The following Stackoverflow link might help https://stackoverflow.com/questions/73240494/can-someone-assist-me-with-a-multi-word-synonym-problem-in-lucene The following thread seems to confirm, that escaping the space with a backslash does not help https://lists.apache.org/list?java-u

Re: Question for SynonymQuery

2022-12-28 Thread Mikhail Khludnev
Hello. 1)Yes. That's the purpose. 2) I've skimmed through QueryBuilder.java. Conclusion is that it creates BQ.SHOULD (however, there should be something like DisjunctionMaxQuery) over PhraseQuery or MultiPhraseQuery (-ies). Good hack! On Wed, Dec 28, 2022 at 2:23 AM Anh Dũng Bùi wrote: > Hi Luc

Question for SynonymQuery

2022-12-27 Thread Anh Dũng Bùi
Hi Lucene users, I recently came across SynonymQuery and found out that it only supports single-term synonyms (since it accepts a list of Term which will be considered as synonyms). We have some multi-term synonyms like "internet device" <-> "wifi router" or "dns" <-> "domain name service". Am I r