You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Zahra Aminolroaya <z....@gmail.com> on 2018/09/11 12:53:51 UTC

Error casting to PointField

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

Re: Error casting to PointField

Posted by Zahra Aminolroaya <z....@gmail.com>.
Thanks Shawn and Erick.



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

Re: Error casting to PointField

Posted by Shawn Heisey <ap...@elyograg.org>.
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


Re: Error casting to PointField

Posted by Erick Erickson <er...@gmail.com>.
People usually just use a string field in place of longs etc..
On Tue, Sep 11, 2018 at 9:15 PM Zahra Aminolroaya
<z....@gmail.com> 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

Re: Error casting to PointField

Posted by Zahra Aminolroaya <z....@gmail.com>.
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

Re: Error casting to PointField

Posted by Erick Erickson <er...@gmail.com>.
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
<z....@gmail.com> 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