Error casting to PointField

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

Error casting to PointField

Zahra Aminolroaya
We read that in Solr 7, Trie* fields are deprecated, so we decided to change
all of our Trie* fields to *pointtype Fields.

Our unique key field type is long, and we changed our long field type
something like below;

<fieldType name="long" class="solr.LongPointField" positionIncrementGap="0"
indexed="false"/>

We get the error uniqueKey field can not be configured to use a Points based
FieldType.


I think it is a bug. If lucene decides to deprecate the Trie* filed type, it
should also think of these kinds of errors.


What is the solution?

Best,
Zahra




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Error casting to PointField

Erick Erickson
point-based fields cannot be used for <uniqueKey>, see:
https://issues.apache.org/jira/browse/SOLR-10829

This should be documented better in the ref guide....
On Tue, Sep 11, 2018 at 5:53 AM Zahra Aminolroaya
<[hidden email]> wrote:

>
> We read that in Solr 7, Trie* fields are deprecated, so we decided to change
> all of our Trie* fields to *pointtype Fields.
>
> Our unique key field type is long, and we changed our long field type
> something like below;
>
> <fieldType name="long" class="solr.LongPointField" positionIncrementGap="0"
> indexed="false"/>
>
> We get the error uniqueKey field can not be configured to use a Points based
> FieldType.
>
>
> I think it is a bug. If lucene decides to deprecate the Trie* filed type, it
> should also think of these kinds of errors.
>
>
> What is the solution?
>
> Best,
> Zahra
>
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Error casting to PointField

Zahra Aminolroaya
Thanks Erick. We used to use TrieLongField for our unique id and in the
document it is said that all Trie* fieldtypes are casting to
*pointfieldtypes. What would be the alternative solution?



Best,

Zahra



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Error casting to PointField

Erick Erickson
People usually just use a string field in place of longs etc..
On Tue, Sep 11, 2018 at 9:15 PM Zahra Aminolroaya
<[hidden email]> wrote:

>
> Thanks Erick. We used to use TrieLongField for our unique id and in the
> document it is said that all Trie* fieldtypes are casting to
> *pointfieldtypes. What would be the alternative solution?
>
>
>
> Best,
>
> Zahra
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Error casting to PointField

Shawn Heisey-2
In reply to this post by Zahra Aminolroaya
On 9/11/2018 10:15 PM, Zahra Aminolroaya wrote:
> Thanks Erick. We used to use TrieLongField for our unique id and in the
> document it is said that all Trie* fieldtypes are casting to
> *pointfieldtypes. What would be the alternative solution?

I've never heard of Trie casting to Point.

Point is the recommended replacement for *similar* but not *identical*
functionality to what Trie provides.

Point fields are excellent at range queries (as an example, field:[500
TO 1000]) ... but they are terrible for single value lookups (such as
id:75224575).  They do not work for the uniqueKey.  I suspect that the
aspect that makes them terrible at single-value lookups is the same
aspect that prevents their use as uniqueKey, but I'm not familiar enough
with the low level details to be able to say for certain.

Trie is also excellent for range queries, but not as good as Point.  It
is very fast at single-value lookups, and can be used as uniqueKey.

Using a string type (class solr.StrField) is one workaround for the
uniqueKey problem.  It allows fast single-value lookups, but you lose
the ability to do numeric range queries.  The string type sorts
alphanumerically, not numerically.

You can keep using Trie for all 7.x versions, but that type will be gone
in 8.0.  Hopefully by that release the limitations in Point types will
be removed.  You'll probably have to reindex if that happens, especially
if the problem is fixed by adding a new set of field types instead of
altering the existing Point types.

Thanks,
Shawn

Reply | Threaded
Open this post in threaded view
|

Re: Error casting to PointField

Zahra Aminolroaya
Thanks Shawn and Erick.



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html