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 Trejkaz <tr...@trypticon.org> on 2017/01/24 05:43:26 UTC
[Deep Esoterica] How do point codecs work?
Hi all.
I'm, considering writing a migration to copy existing doc values into
points (after which I will discard their postings). So essentially I
have to implement three things:
public void intersect(String fieldName, IntersectVisitor visitor)
throws IOException
public byte[] getMinPackedValue(String fieldName) throws IOException
public byte[] getMaxPackedValue(String fieldName) throws IOException
It looks like LongPoint.encodeDimension is the encoding I want to
convert the values themselves.
The docs on this "intersect" thing are talking about a query... I
assume the visitor itself is conceptually the query in this context...
...but is the right thing to do here just to call visit() (ah, but
which one?) for every value? In a particular order? ;) Or is there
something even more tricky I'm supposed to do?
TX
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: [Deep Esoterica] How do point codecs work?
Posted by Trejkaz <tr...@trypticon.org>.
On Tue, Jan 24, 2017 at 10:21 PM, Michael McCandless
<lu...@mikemccandless.com> wrote:
> Hi Trejkaz,
>
> A normal codec would call visitor.compare on smaller and smaller cells
> (1D ranges for the 1D case) of the byte[] space and depending on that
> result would call one of the visit methods, or skip that cell if
> compare returned CELL_OUTSIDE_QUERY.
>
> I think for your case (to migrate all values) you could simply call
> visitor.visit(int docID, byte[] packedValue) for every value in the
> segment.
This does appear to be working. Although admittedly I don't have any
very good tests yet. :)
TX
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: [Deep Esoterica] How do point codecs work?
Posted by Michael McCandless <lu...@mikemccandless.com>.
Hi Trejkaz,
A normal codec would call visitor.compare on smaller and smaller cells
(1D ranges for the 1D case) of the byte[] space and depending on that
result would call one of the visit methods, or skip that cell if
compare returned CELL_OUTSIDE_QUERY.
I think for your case (to migrate all values) you could simply call
visitor.visit(int docID, byte[] packedValue) for every value in the
segment.
Mike McCandless
http://blog.mikemccandless.com
On Tue, Jan 24, 2017 at 12:43 AM, Trejkaz <tr...@trypticon.org> wrote:
> Hi all.
>
> I'm, considering writing a migration to copy existing doc values into
> points (after which I will discard their postings). So essentially I
> have to implement three things:
>
> public void intersect(String fieldName, IntersectVisitor visitor)
> throws IOException
> public byte[] getMinPackedValue(String fieldName) throws IOException
> public byte[] getMaxPackedValue(String fieldName) throws IOException
>
> It looks like LongPoint.encodeDimension is the encoding I want to
> convert the values themselves.
>
> The docs on this "intersect" thing are talking about a query... I
> assume the visitor itself is conceptually the query in this context...
>
> ...but is the right thing to do here just to call visit() (ah, but
> which one?) for every value? In a particular order? ;) Or is there
> something even more tricky I'm supposed to do?
>
>
> TX
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org