You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Cristian Lorenzetto <cr...@gmail.com> on 2016/08/03 12:42:46 UTC

how to introduce a evaluator for comparing not only document with fixed values

hi i need a help.

I want create a lucene query parser for adding evaluation of expression in
lucene
value1:>= value2   where value1 and value2 are 2 field names in the
document.

how to do it?
for me it is sufficient also to work programatically creating a new Query
Object making it

Re: how to introduce a evaluator for comparing not only document with fixed values

Posted by Cristian Lorenzetto <cr...@gmail.com>.
i m thinkking another solution : it could also possible building additional
info in relation to the query to use :).

2016-08-03 19:27 GMT+02:00 Cristian Lorenzetto <
cristian.lorenzetto@gmail.com>:

>  yes internally lucene could make a lot of things for reaching target:
>  - it could add info map {-1,0,1,undefined} 2 bit for every combination of
> concrete fields. With additional short array it could make possible it. for
> ordinable comparation. i think it is not so difficult to do for lucene
> developers.
> -  more difficult is to add pattern matching info. probably it could be
> possible applying patterni matching machine to a global suffix tree index .
>
> 2016-08-03 15:09 GMT+02:00 Adrien Grand <jp...@gmail.com>:
>
>> Lucene cannot run such a query without doing a linear scan over all
>> documents in order to compare the values of both fields, this is why we do
>> not have a query for it. The recommended approach in such cases is to
>> index
>> a third field where the difference between value1 and value2 is computed
>> at
>> index time.
>>
>> Le mer. 3 août 2016 à 14:42, Cristian Lorenzetto <
>> cristian.lorenzetto@gmail.com> a écrit :
>>
>> > hi i need a help.
>> >
>> > I want create a lucene query parser for adding evaluation of expression
>> in
>> > lucene
>> > value1:>= value2   where value1 and value2 are 2 field names in the
>> > document.
>> >
>> > how to do it?
>> > for me it is sufficient also to work programatically creating a new
>> Query
>> > Object making it
>> >
>>
>
>

Re: how to introduce a evaluator for comparing not only document with fixed values

Posted by Cristian Lorenzetto <cr...@gmail.com>.
 yes internally lucene could make a lot of things for reaching target:
 - it could add info map {-1,0,1,undefined} 2 bit for every combination of
concrete fields. With additional short array it could make possible it. for
ordinable comparation. i think it is not so difficult to do for lucene
developers.
-  more difficult is to add pattern matching info. probably it could be
possible applying patterni matching machine to a global suffix tree index .

2016-08-03 15:09 GMT+02:00 Adrien Grand <jp...@gmail.com>:

> Lucene cannot run such a query without doing a linear scan over all
> documents in order to compare the values of both fields, this is why we do
> not have a query for it. The recommended approach in such cases is to index
> a third field where the difference between value1 and value2 is computed at
> index time.
>
> Le mer. 3 août 2016 à 14:42, Cristian Lorenzetto <
> cristian.lorenzetto@gmail.com> a écrit :
>
> > hi i need a help.
> >
> > I want create a lucene query parser for adding evaluation of expression
> in
> > lucene
> > value1:>= value2   where value1 and value2 are 2 field names in the
> > document.
> >
> > how to do it?
> > for me it is sufficient also to work programatically creating a new Query
> > Object making it
> >
>

Re: how to introduce a evaluator for comparing not only document with fixed values

Posted by Adrien Grand <jp...@gmail.com>.
Lucene cannot run such a query without doing a linear scan over all
documents in order to compare the values of both fields, this is why we do
not have a query for it. The recommended approach in such cases is to index
a third field where the difference between value1 and value2 is computed at
index time.

Le mer. 3 août 2016 à 14:42, Cristian Lorenzetto <
cristian.lorenzetto@gmail.com> a écrit :

> hi i need a help.
>
> I want create a lucene query parser for adding evaluation of expression in
> lucene
> value1:>= value2   where value1 and value2 are 2 field names in the
> document.
>
> how to do it?
> for me it is sufficient also to work programatically creating a new Query
> Object making it
>