lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien Grand <>
Subject Re: Question: find term by position and document id
Date Thu, 05 Apr 2018 12:44:23 GMT
Indeed it is not possible to do something like this efficiently. The only
way to do something like this that I know of would be to index shingles and
then query them by prefix.

Le jeu. 5 avr. 2018 à 14:11, Adam Hornacek <> a
écrit :

> Hello,
> I’m having difficulty finding a solution to the following problem:
> I’m trying to implement suggestions for PhraseQuery. Let’s say we have a
> PhraseQuery in the form "com.example". I would like to find all the terms
> that are right after the `example` term. From the implementation of the
> PhraseQuery I was able to gather that it checks term positions; therefore,
> I thought that it could be possible to find the term by the document id and
> the position. However, I was not able to get much further.
> `TermsEnum#ord()` (
> looks promising but it looks like the ordinal number is specific and does
> not correlate to the term positions. `tokenStream()` call does not seem
> feasible since it requires iterating over the terms and might be slow.
> Thank you very much for any input or suggestion.
> Yours sincerely,
> Adam Hornáček
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message