What does "group by" mean on a field with more than one value? Say I
have "A" and "B" in the field in a single document. What group does it
go in, one labeld "A" or one labeled "B"?

So IIUC, rather than do something which will be wrong it throws an
error if the field is defined as multiValued. And whatever option is
chosen (e.g. use the min or max or....) will be wrong sometime.

Although admittedly the error is a bit obscure...

Best,
Erick

On Mon, Feb 26, 2018 at 7:37 AM, Vincenzo D'Amore <v.dam...@gmail.com> wrote:
> Hi Amrit,
>
> thanks for your help.
>
> I know that only 5/10% of documents in the collection have more than one
> value for the field I was trying to group by.
>
> So there isn't a particular memory usage in this case. Do you know if there
> is any other counter-indication I have to be aware of?
>
> I was thinking to avoid this problem hacking the source code and deploy a
> personalised version of Solr.
>
> Best regards,
> Vincenzo
>
>
>
> On Mon, Feb 26, 2018 at 3:22 PM, Amrit Sarkar <sarkaramr...@gmail.com>
> wrote:
>
>> Vincenzo,
>>
>> As I read the source code;  SchemaField.java
>>
>> /**
>>  * Sanity checks that the properties of this field type are plausible
>>  * for a field that may be used to get a FieldCacheSource, throwing
>>  * an appropriate exception (including the field name) if it is not.
>>  * FieldType subclasses can choose to call this method in their
>>  * getValueSource implementation
>>  * @see FieldType#getValueSource
>>  */
>> public void checkFieldCacheSource() throws SolrException {
>>   if ( multiValued() ) {
>>     throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
>>                             "can not use FieldCache on multivalued field: "
>>                             + getName());
>>   }
>>   if (! hasDocValues() ) {
>>     if ( ! ( indexed() && null != this.type.getUninversionType(this) ) ) {
>>       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
>>                               "can not use FieldCache on a field w/o
>> docValues unless it is indexed and supports Uninversion: "
>>                               + getName());
>>     }
>>   }
>> }
>>
>> Seems like FieldCache are not allowed to un-invert values for
>> multi-valued fields.
>>
>> I can suspect the reason, multiple values will eat up more memory? Not
>> sure, someone else can weigh in.
>>
>>
>>
>> Amrit Sarkar
>> Search Engineer
>> Lucidworks, Inc.
>> 415-589-9269
>> www.lucidworks.com
>> Twitter http://twitter.com/lucidworks
>> LinkedIn: https://www.linkedin.com/in/sarkaramrit2
>> Medium: https://medium.com/@sarkaramrit2
>>
>> On Mon, Feb 26, 2018 at 7:37 PM, Vincenzo D'Amore <v.dam...@gmail.com>
>> wrote:
>>
>> > Hi,
>> >
>> > while trying to run a group query on a multivalue field I received this
>> > error:
>> >
>> > can not use FieldCache on multivalued field:
>> >
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <response>
>> >
>> > <lst name="responseHeader">
>> >   <bool name="zkConnected">true</bool>
>> >   <int name="status">400</int>
>> >   <int name="QTime">4</int>
>> > </lst>
>> > <lst name="error">
>> >   <lst name="metadata">
>> >     <str name="error-class">org.apache.solr.common.SolrException</str>
>> >     <str name="root-error-class">org.apache.solr.common.
>> > SolrException</str>
>> >   </lst>
>> >   <str name="msg">can not use FieldCache on multivalued field:
>> > categoryLevels</str>
>> >   <int name="code">400</int>
>> > </lst>
>> > </response>
>> >
>> > I don't understand why this is happening.
>> >
>> > Do you know any way to work around this problem?
>> >
>> > Thanks in advance,
>> > Vincenzo
>> >
>> > --
>> > Vincenzo D'Amore
>> >
>>
>
>
>
> --
> Vincenzo D'Amore

Reply via email to