What's the difference between LatLonPoint and LatLonDocValuesField?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What's the difference between LatLonPoint and LatLonDocValuesField?

小鱼儿-2
In my understanding from reading the oniline documentation, LatLonPoint is
used for BKD indexing, and LatLonDocValuesField is used for Sort argument's
input.

But does it means if a POI has a GeoPoint type "location" field, then i
must add the same location value to the 2 fields which makes me confusing:
because the api exposes internals to api users...

There seems 2 kind of Fields: one is the normal XxxField which is for
indexing and is row-stored, the other (XxxDocValuesField) is
column-stored, LatLonPoint may be taken as indexing field...

In my opinion, the 2 fields are both stored, so StoredField's naming is
somewhat misleading, if i add another StoredField with the same field name,
then later when using List<IndexableField> L = doc.getFields(); to retrieve
the document fields, i only get the last StoredField
value,  LatLonDocValuesField is not got.
Reply | Threaded
Open this post in threaded view
|

Re: What's the difference between LatLonPoint and LatLonDocValuesField?

Adrien Grand
Your understanding is correct. It is common to index geo points by creating
a LatLonPoint, a LatLonDocValuesField and a StoredField. Even though
LatLonDocValuesField is stored in the index, the fact it's column-stored
makes it a good choice for sorting or facets, but a poor choice to retrieve
information about a hit, which is why doc.getFields() doesn't return it.

On Fri, Jan 10, 2020 at 9:06 AM 小鱼儿 <[hidden email]> wrote:

> In my understanding from reading the oniline documentation, LatLonPoint is
> used for BKD indexing, and LatLonDocValuesField is used for Sort argument's
> input.
>
> But does it means if a POI has a GeoPoint type "location" field, then i
> must add the same location value to the 2 fields which makes me confusing:
> because the api exposes internals to api users...
>
> There seems 2 kind of Fields: one is the normal XxxField which is for
> indexing and is row-stored, the other (XxxDocValuesField) is
> column-stored, LatLonPoint may be taken as indexing field...
>
> In my opinion, the 2 fields are both stored, so StoredField's naming is
> somewhat misleading, if i add another StoredField with the same field name,
> then later when using List<IndexableField> L = doc.getFields(); to retrieve
> the document fields, i only get the last StoredField
> value,  LatLonDocValuesField is not got.
>


--
Adrien