lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Davis <kryptonics...@gmail.com>
Subject Re: Searching number of tokens in text field
Date Mon, 30 Dec 2019 00:57:01 GMT
That is a clever idea.  I would still prefer something cleaner but this
could work.  Thanks!

On Sat, Dec 28, 2019 at 10:11 PM Michael Sokolov <msokolov@gmail.com> wrote:

> I don't know of any pre-existing thing that does exactly this, but how
> about a token filter that counts tokens (or positions maybe), and then
> appends some special token encoding the length?
>
> On Sat, Dec 28, 2019, 9:36 AM Matt Davis <kryptonics411@gmail.com> wrote:
>
> > Hello,
> >
> > I was wondering if it is possible to search for the number of tokens in a
> > text field.  For example find book titles with 3 or more words.  I don't
> > mind adding a field that is the number of tokens to the search index but
> I
> > would like to avoid analyzing the text two times.   Can Lucene search for
> > the number of tokens in a text field?  Or can I get the number of tokens
> > after analysis and add it to the Lucene document before/during indexing?
> > Or do I need to analysis the text myself and add the field to the
> document
> > (analyze the text twice, once myself, once in the IndexWriter).
> >
> > Thanks,
> > Matt Davis
> >
>

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