[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    Re: Question About FST, multiple-column index
From:       Michael McCandless <lucene () mikemccandless ! com>
Date:       2018-09-23 3:25:34
Message-ID: CAL8PwkaZsDSfd43Uivub1F3mM-rZiWYZ1xVqPMrqAi9E6a8cQg () mail ! gmail ! com
[Download RAW message or body]


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=E9=93=96 <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 i=
s
> there any solutions to extends to FST which make the FINAL state connect =
to
> another FST?
>
>
> THANKS


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic