Lucene API to retrieve matched words

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Lucene API to retrieve matched words

Mike Grishaber
Hello All,

 

I am trying to find a way to retrieve a list of the words that matched a
query.  I'm not looking for highlighting, just a list of the words.  So if I
search for 'ski' and I match on 'skier' and 'skiis', I would like to get
back a list that includes 'skier' and 'skiis'.

Is there an API call that provides this?

 

Thanks

Mike

Reply | Threaded
Open this post in threaded view
|

Re: Lucene API to retrieve matched words

baris.kazar
Except TermQuery which does exact match, you can do <search_word>* by appending star char. In Oracle Database Sql it is like the % char.
Hope this helps
Best



> On Sep 5, 2018, at 5:38 PM, Mike Grishaber <[hidden email]> wrote:
>
> Hello All,
>
>
>
> I am trying to find a way to retrieve a list of the words that matched a
> query.  I'm not looking for highlighting, just a list of the words.  So if I
> search for 'ski' and I match on 'skier' and 'skiis', I would like to get
> back a list that includes 'skier' and 'skiis'.
>
> Is there an API call that provides this?
>
>
>
> Thanks
>
> Mike
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Lucene API to retrieve matched words

Michael Sokolov-4
In reply to this post by Mike Grishaber
If what you want is to undo the analysis and find text in the original
document that was transformed into the terms that matched your query, that
is what highlighters are for. Do you have a reason not to want to use the
highlighters?

On Wed, Sep 5, 2018, 5:39 PM Mike Grishaber <[hidden email]>
wrote:

> Hello All,
>
>
>
> I am trying to find a way to retrieve a list of the words that matched a
> query.  I'm not looking for highlighting, just a list of the words.  So if
> I
> search for 'ski' and I match on 'skier' and 'skiis', I would like to get
> back a list that includes 'skier' and 'skiis'.
>
> Is there an API call that provides this?
>
>
>
> Thanks
>
> Mike
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Lucene API to retrieve matched words

Mikhail Khludnev-2
In reply to this post by Mike Grishaber
Hello.

What about MultiFields.getTerms().iterator().seekCeil(new BytesRef("ski")) ?

On Thu, Sep 6, 2018 at 12:39 AM Mike Grishaber <[hidden email]>
wrote:

> Hello All,
>
>
>
> I am trying to find a way to retrieve a list of the words that matched a
> query.  I'm not looking for highlighting, just a list of the words.  So if
> I
> search for 'ski' and I match on 'skier' and 'skiis', I would like to get
> back a list that includes 'skier' and 'skiis'.
>
> Is there an API call that provides this?
>
>
>
> Thanks
>
> Mike
>
>

--
Sincerely yours
Mikhail Khludnev