You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Nitish Jain <ni...@gmail.com> on 2022/08/14 18:35:46 UTC

Lucene Suggester APIs question

Hi,

I have a question about lucene suggester APIs. If I build multiple FSTs
using a suggester, is there a way to merge two generated FSTs?

-- 

Nitish Jain

Re: Lucene Suggester APIs question

Posted by Mikhail Khludnev <mk...@apache.org>.
Hello Nitish.

What about
https://lucene.apache.org/core/7_2_1/core/org/apache/lucene/util/automaton/Operations.html#union-org.apache.lucene.util.automaton.Automaton-org.apache.lucene.util.automaton.Automaton-
?

On Mon, Aug 15, 2022 at 4:42 AM Nitish Jain <ni...@gmail.com>
wrote:

> Hi,
>
> I have a question about lucene suggester APIs. If I build multiple FSTs
> using a suggester, is there a way to merge two generated FSTs?
>
> --
>
> Nitish Jain
>


-- 
Sincerely yours
Mikhail Khludnev

Re: Lucene Suggester APIs question

Posted by Dawid Weiss <da...@gmail.com>.
Yes, you need to build a third FST. You can build a merging iterator
that will combine two or more FST traversal streams so that they're in
order and then build a merged FST directly, with no extra sorting cost.

https://lucene.apache.org/core/7_1_0/core/org/apache/lucene/util/fst/Builder.html#add-org.apache.lucene.util.IntsRef-T-

This should be fast as fst construction is linear with data size (if
it's sorted).

Dawid


D.

On Mon, Aug 15, 2022 at 4:36 PM Nitish Jain <ni...@gmail.com> wrote:
>
> Hi,
>
> I have a question about lucene suggester APIs. If I build multiple FSTs
> using a suggester, is there a way to merge two generated FSTs?
>
> --
>
> Nitish Jain

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Lucene Suggester APIs question

Posted by Dawid Weiss <da...@gmail.com>.
Yes, you need to build a third FST. You can build a merging iterator
that will combine two or more FST traversal streams so that they're in
order and then build a merged FST directly, with no extra sorting cost.

https://lucene.apache.org/core/7_1_0/core/org/apache/lucene/util/fst/Builder.html#add-org.apache.lucene.util.IntsRef-T-

This should be fast as fst construction is linear with data size (if
it's sorted).

Dawid


D.

On Mon, Aug 15, 2022 at 4:36 PM Nitish Jain <ni...@gmail.com> wrote:
>
> Hi,
>
> I have a question about lucene suggester APIs. If I build multiple FSTs
> using a suggester, is there a way to merge two generated FSTs?
>
> --
>
> Nitish Jain

Re: Lucene Suggester APIs question

Posted by Mikhail Khludnev <mk...@apache.org>.
Hello Nitish.

What about
https://lucene.apache.org/core/7_2_1/core/org/apache/lucene/util/automaton/Operations.html#union-org.apache.lucene.util.automaton.Automaton-org.apache.lucene.util.automaton.Automaton-
?

On Mon, Aug 15, 2022 at 4:42 AM Nitish Jain <ni...@gmail.com>
wrote:

> Hi,
>
> I have a question about lucene suggester APIs. If I build multiple FSTs
> using a suggester, is there a way to merge two generated FSTs?
>
> --
>
> Nitish Jain
>


-- 
Sincerely yours
Mikhail Khludnev