You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Szűcs Roland <sz...@bookandwalk.hu> on 2023/06/27 09:51:33 UTC

primitive integer field

Hi Solr developers,

I would like to have a price field in Solr with integer type. I need to
store it. In addition to show it in the search result, the only role of
this field is to use it as a range filter.

My question is what fieldType should I use as a best practice. I have read
that:
"For general numeric needs, consider using one of the IntPointField,
LongPointField, FloatPointField, or DoublePointField classes, depending on
the specific values you expect. These "Dimensional Point" based numeric
classes use specially encoded data structures to support efficient range
queries regardless of the size of the ranges used. Enable DocValues
<https://solr.apache.org/guide/solr/latest/indexing-guide/docvalues.html> on
these fields as needed for sorting and/or faceting."
Based on this, am I correct that I should use InpointField with
indexed="false" stored="true" docValues="true" for my use case?

Thanks in advance,
Roland

P.S.: It is not clear at all what does "Dimensional Point" means for a
scalar value

Re: primitive integer field

Posted by Ishan Chattopadhyaya <ic...@gmail.com>.
You can also enable indexed=true to avail range queries using the BKD
Trees.

On Tue, 27 Jun, 2023, 5:54 pm Ishan Chattopadhyaya, <
ichattopadhyaya@gmail.com> wrote:

> You can use an IntPointField with indexed=false, stored=false,
> docValues=true.
>
> On Tue, 27 Jun, 2023, 3:23 pm Szűcs Roland, <sz...@bookandwalk.hu>
> wrote:
>
>> Hi Solr developers,
>>
>> I would like to have a price field in Solr with integer type. I need to
>> store it. In addition to show it in the search result, the only role of
>> this field is to use it as a range filter.
>>
>> My question is what fieldType should I use as a best practice. I have read
>> that:
>> "For general numeric needs, consider using one of the IntPointField,
>> LongPointField, FloatPointField, or DoublePointField classes, depending on
>> the specific values you expect. These "Dimensional Point" based numeric
>> classes use specially encoded data structures to support efficient range
>> queries regardless of the size of the ranges used. Enable DocValues
>> <https://solr.apache.org/guide/solr/latest/indexing-guide/docvalues.html>
>> on
>> these fields as needed for sorting and/or faceting."
>> Based on this, am I correct that I should use InpointField with
>> indexed="false" stored="true" docValues="true" for my use case?
>>
>> Thanks in advance,
>> Roland
>>
>> P.S.: It is not clear at all what does "Dimensional Point" means for a
>> scalar value
>>
>

Re: primitive integer field

Posted by Ishan Chattopadhyaya <ic...@gmail.com>.
You can use an IntPointField with indexed=false, stored=false,
docValues=true.

On Tue, 27 Jun, 2023, 3:23 pm Szűcs Roland, <sz...@bookandwalk.hu>
wrote:

> Hi Solr developers,
>
> I would like to have a price field in Solr with integer type. I need to
> store it. In addition to show it in the search result, the only role of
> this field is to use it as a range filter.
>
> My question is what fieldType should I use as a best practice. I have read
> that:
> "For general numeric needs, consider using one of the IntPointField,
> LongPointField, FloatPointField, or DoublePointField classes, depending on
> the specific values you expect. These "Dimensional Point" based numeric
> classes use specially encoded data structures to support efficient range
> queries regardless of the size of the ranges used. Enable DocValues
> <https://solr.apache.org/guide/solr/latest/indexing-guide/docvalues.html>
> on
> these fields as needed for sorting and/or faceting."
> Based on this, am I correct that I should use InpointField with
> indexed="false" stored="true" docValues="true" for my use case?
>
> Thanks in advance,
> Roland
>
> P.S.: It is not clear at all what does "Dimensional Point" means for a
> scalar value
>

Re: primitive integer field

Posted by Houston Putman <ho...@apache.org>.
Sorting and faceting use docValues for the fastest implementation, range
queries use the index for the fastest implementation.

In general I would advise to have everything (indexed, docValues, stored)
turned on unless you have an explicit reason not to.

- Houston

On Tue, Jun 27, 2023 at 9:57 AM Szűcs Roland <sz...@bookandwalk.hu>
wrote:

> I planned to use only docValues="true" for an intPointField. is It not
> enough for efficient faceting, range queries and sorting? Do I need
> indexed="true" in addition to the docsValues?
>
> Roland
>
> Ishan Chattopadhyaya <ic...@gmail.com> ezt írta (időpont: 2023.
> jún. 27., K, 14:43):
>
> > If you disable docValues, then you would need stored=true to return the
> > values along with the search results.
> >
> > On Tue, 27 Jun, 2023, 6:06 pm Jan Høydahl, <ja...@cominvent.com>
> wrote:
> >
> > > You need indexed="true" to enable the dimensional index structure
> > > supporting range filters. If you do not ever need sorting on the field
> I
> > > suppose you could disable docValues.
> > >
> > > Jan
> > >
> > > > 27. jun. 2023 kl. 11:51 skrev Szűcs Roland <
> > szucs.roland@bookandwalk.hu
> > > >:
> > > >
> > > > Hi Solr developers,
> > > >
> > > > I would like to have a price field in Solr with integer type. I need
> to
> > > > store it. In addition to show it in the search result, the only role
> of
> > > > this field is to use it as a range filter.
> > > >
> > > > My question is what fieldType should I use as a best practice. I have
> > > read
> > > > that:
> > > > "For general numeric needs, consider using one of the IntPointField,
> > > > LongPointField, FloatPointField, or DoublePointField classes,
> depending
> > > on
> > > > the specific values you expect. These "Dimensional Point" based
> numeric
> > > > classes use specially encoded data structures to support efficient
> > range
> > > > queries regardless of the size of the ranges used. Enable DocValues
> > > > <
> > https://solr.apache.org/guide/solr/latest/indexing-guide/docvalues.html>
> > > on
> > > > these fields as needed for sorting and/or faceting."
> > > > Based on this, am I correct that I should use InpointField with
> > > > indexed="false" stored="true" docValues="true" for my use case?
> > > >
> > > > Thanks in advance,
> > > > Roland
> > > >
> > > > P.S.: It is not clear at all what does "Dimensional Point" means for
> a
> > > > scalar value
> > >
> > >
> >
>

Re: primitive integer field

Posted by Szűcs Roland <sz...@bookandwalk.hu>.
I planned to use only docValues="true" for an intPointField. is It not
enough for efficient faceting, range queries and sorting? Do I need
indexed="true" in addition to the docsValues?

Roland

Ishan Chattopadhyaya <ic...@gmail.com> ezt írta (időpont: 2023.
jún. 27., K, 14:43):

> If you disable docValues, then you would need stored=true to return the
> values along with the search results.
>
> On Tue, 27 Jun, 2023, 6:06 pm Jan Høydahl, <ja...@cominvent.com> wrote:
>
> > You need indexed="true" to enable the dimensional index structure
> > supporting range filters. If you do not ever need sorting on the field I
> > suppose you could disable docValues.
> >
> > Jan
> >
> > > 27. jun. 2023 kl. 11:51 skrev Szűcs Roland <
> szucs.roland@bookandwalk.hu
> > >:
> > >
> > > Hi Solr developers,
> > >
> > > I would like to have a price field in Solr with integer type. I need to
> > > store it. In addition to show it in the search result, the only role of
> > > this field is to use it as a range filter.
> > >
> > > My question is what fieldType should I use as a best practice. I have
> > read
> > > that:
> > > "For general numeric needs, consider using one of the IntPointField,
> > > LongPointField, FloatPointField, or DoublePointField classes, depending
> > on
> > > the specific values you expect. These "Dimensional Point" based numeric
> > > classes use specially encoded data structures to support efficient
> range
> > > queries regardless of the size of the ranges used. Enable DocValues
> > > <
> https://solr.apache.org/guide/solr/latest/indexing-guide/docvalues.html>
> > on
> > > these fields as needed for sorting and/or faceting."
> > > Based on this, am I correct that I should use InpointField with
> > > indexed="false" stored="true" docValues="true" for my use case?
> > >
> > > Thanks in advance,
> > > Roland
> > >
> > > P.S.: It is not clear at all what does "Dimensional Point" means for a
> > > scalar value
> >
> >
>

Re: primitive integer field

Posted by Ishan Chattopadhyaya <ic...@gmail.com>.
If you disable docValues, then you would need stored=true to return the
values along with the search results.

On Tue, 27 Jun, 2023, 6:06 pm Jan Høydahl, <ja...@cominvent.com> wrote:

> You need indexed="true" to enable the dimensional index structure
> supporting range filters. If you do not ever need sorting on the field I
> suppose you could disable docValues.
>
> Jan
>
> > 27. jun. 2023 kl. 11:51 skrev Szűcs Roland <szucs.roland@bookandwalk.hu
> >:
> >
> > Hi Solr developers,
> >
> > I would like to have a price field in Solr with integer type. I need to
> > store it. In addition to show it in the search result, the only role of
> > this field is to use it as a range filter.
> >
> > My question is what fieldType should I use as a best practice. I have
> read
> > that:
> > "For general numeric needs, consider using one of the IntPointField,
> > LongPointField, FloatPointField, or DoublePointField classes, depending
> on
> > the specific values you expect. These "Dimensional Point" based numeric
> > classes use specially encoded data structures to support efficient range
> > queries regardless of the size of the ranges used. Enable DocValues
> > <https://solr.apache.org/guide/solr/latest/indexing-guide/docvalues.html>
> on
> > these fields as needed for sorting and/or faceting."
> > Based on this, am I correct that I should use InpointField with
> > indexed="false" stored="true" docValues="true" for my use case?
> >
> > Thanks in advance,
> > Roland
> >
> > P.S.: It is not clear at all what does "Dimensional Point" means for a
> > scalar value
>
>

Re: primitive integer field

Posted by Jan Høydahl <ja...@cominvent.com>.
You need indexed="true" to enable the dimensional index structure supporting range filters. If you do not ever need sorting on the field I suppose you could disable docValues.

Jan

> 27. jun. 2023 kl. 11:51 skrev Szűcs Roland <sz...@bookandwalk.hu>:
> 
> Hi Solr developers,
> 
> I would like to have a price field in Solr with integer type. I need to
> store it. In addition to show it in the search result, the only role of
> this field is to use it as a range filter.
> 
> My question is what fieldType should I use as a best practice. I have read
> that:
> "For general numeric needs, consider using one of the IntPointField,
> LongPointField, FloatPointField, or DoublePointField classes, depending on
> the specific values you expect. These "Dimensional Point" based numeric
> classes use specially encoded data structures to support efficient range
> queries regardless of the size of the ranges used. Enable DocValues
> <https://solr.apache.org/guide/solr/latest/indexing-guide/docvalues.html> on
> these fields as needed for sorting and/or faceting."
> Based on this, am I correct that I should use InpointField with
> indexed="false" stored="true" docValues="true" for my use case?
> 
> Thanks in advance,
> Roland
> 
> P.S.: It is not clear at all what does "Dimensional Point" means for a
> scalar value