lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Question About FST, multiple-column index
Date Sun, 23 Sep 2018 03:25:34 GMT
You might want to index the name field normally (as StringField, for
example), then index the age as a NumericDocValuesField, and then make a
BooleanQuery with two required clauses, one clause TermQuery on the name,
the other a NumericDocValuesField.newSlowExactQuery.  Even though its name
is "slow", it can be very fast for cases like what you are doing, where you
expect very few matches by name, and many many matches with exactly a
specific age.

This is assuming you want precise (including case) matching on the name; if
you do not, then index the name as TextField, and analyzing the search
terms at query time using a query parser.

Mike McCandless

http://blog.mikemccandless.com


On Thu, Sep 20, 2018 at 10:57 AM lyé“– <52048436@qq.com> wrote:

> Hi,
>
>
> When I using Lucene as a Full Text search engine, I have a question about
> multi field index. For example, We have two fields: user, age. We always
> want to search one user which name is "xxx" and with the exactly age. So we
> add two fields to the lucene(may be there is better ways, I just want to
> explain my question ). In this case, we can see user result dataset is
> small, age result dataset is much more than previous. Even If lucene use
> Leading Query to reduce query result bitsets. but I wonder is there any
> Combined Index structure like multiple-column indexes in mysql? I think is
> there any solutions to extends to FST which make the FINAL state connect to
> another FST?
>
>
> THANKS

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