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 Aman Deep Singh <am...@gmail.com> on 2017/06/16 08:39:17 UTC

Facet is not working while querying with group

Hi,
Facets are not working when i'm querying with group command
request-
facet.field=isBlibliShipping&facet=true&group.facet=true&group.field=productCode&group=true&indent=on&q=*:*&wt=json

Schema for facet field
<field name="isBlibliShipping" type="tint" docValues="true" multiValued=
"false" indexed="true"stored="true"/>

It was throwing error stating
Type mismatch: isBlibliShipping was indexed with multiple values per
document, use SORTED_SET instead

The full stacktrace is attached as below
2017-06-16 08:20:47.367 INFO  (qtp1205044462-12) [c:productCollection
s:shard1 r:core_node1 x:productCollection_shard1_replica1]
o.a.s.c.S.Request [productCollection_shard1_replica1]  webapp=/solr
path=/select
params={q=*:*&facet.field=isBlibliShipping&indent=on&group.facet=true&facet=true&wt=json&group.field=productCode&_=1497601224212&group=true}
hits=5346 status=500 QTime=29
2017-06-16 08:20:47.369 ERROR (qtp1205044462-12) [c:productCollection
s:shard1 r:core_node1 x:productCollection_shard1_replica1]
o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException: *Exception
during facet.field: isBlibliShipping*
    at
org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:809)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.solr.request.SimpleFacets$3.execute(SimpleFacets.java:742)
    at
org.apache.solr.request.SimpleFacets.getFacetFieldCounts(SimpleFacets.java:818)
    at
org.apache.solr.handler.component.FacetComponent.getFacetCounts(FacetComponent.java:330)
    at
org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:274)
    at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:296)
    at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
    at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)
    at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
    at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:361)
    at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:305)
    at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)
    at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
    at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
    at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
    at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
    at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
    at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at
org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
    at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:534)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
    at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at
org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)
Caused by: *java.lang.IllegalStateException: Type mismatch:
isBlibliShipping was indexed with multiple values per document, use
SORTED_SET instead*
    at
org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.createValue(FieldCacheImpl.java:799)
    at
org.apache.solr.uninverting.FieldCacheImpl$Cache.get(FieldCacheImpl.java:187)
    at
org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:767)
    at
org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:747)
    at
org.apache.solr.uninverting.UninvertingReader.getSortedDocValues(UninvertingReader.java:319)
    at org.apache.lucene.index.DocValues.getSorted(DocValues.java:262)
    at
org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.doSetNextReader(TermGroupFacetCollector.java:129)
    at
org.apache.lucene.search.SimpleCollector.getLeafCollector(SimpleCollector.java:33)
    at
org.apache.solr.request.SimpleFacets$2.getLeafCollector(SimpleFacets.java:730)
    at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:659)
    at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:472)
    at
org.apache.solr.request.SimpleFacets.getGroupedCounts(SimpleFacets.java:692)
    at
org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:476)
    at
org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:405)
    at
org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:803)
    ... 39 more

However if I try to query without grouping it is working fine.
Any Idea how to fix this.

Thanks,
Aman Deep Singh

Re: Facet is not working while querying with group

Posted by Aman Deep Singh <am...@gmail.com>.
1. No it is with schema with some dynamic fields but facet fields are
proper field
2. No copy field is stored field all are set as stored=false



On Fri, Jun 23, 2017 at 10:21 PM Erick Erickson <er...@gmail.com>
wrote:

> OK, new collection.
>
> 1> With schemaless? When you add a document in schemaless mode, it
> makes some guesses that may not play nice later.
>
> 2> Are you storing the _destination_ of any copyField? Atomic updates
> do odd things if you set stored="true" for fields that are
> destinations for atomic updates, specifically accumulate values in
> them. You should set stored="false" for all destinations of copyField
> directives.
>
> Best,
> Erick
>
> On Fri, Jun 23, 2017 at 9:23 AM, Aman Deep Singh
> <am...@gmail.com> wrote:
> > No Shawn,
> > I download the latest solr again then run without installing by command
> > ./bin/solr -c
> > after upload the fresh configset and create the new collection
> > Then create a single document in solr
> > after do atomic update
> > and the same error occurs again.
> >
> >
> > On Fri, Jun 23, 2017 at 7:53 PM Shawn Heisey <ap...@elyograg.org>
> wrote:
> >
> >> On 6/20/2017 11:01 PM, Aman Deep Singh wrote:
> >> > If I am using docValues=false getting this exception
> >> > java.lang.IllegalStateException: Type mismatch: isBlibliShipping was
> >> > indexed with multiple values per document, use SORTED_SET instead at
> >> >
> >>
> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.createValue(FieldCacheImpl.java:799)
> >> > at
> >> >
> >>
> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(FieldCacheImpl.java:187)
> >> > at
> >> >
> >>
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:767)
> >> > at
> >> >
> >>
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:747)
> >> > at
> >> > But if docValues=true then getting this error
> >> > java.lang.IllegalStateException: unexpected docvalues type NUMERIC for
> >> > field 'isBlibliShipping' (expected=SORTED). Re-index with correct
> >> docvalues
> >> > type. at
> org.apache.lucene.index.DocValues.checkField(DocValues.java:212)
> >> > at org.apache.lucene.index.DocValues.getSorted(DocValues.java:264) at
> >> >
> >>
> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.doSetNextReader(TermGroupFacetCollector.java:129)
> >> > at
> >> >
> >>
> org.apache.lucene.search.SimpleCollector.getLeafCollector(SimpleCollector.java:33)
> >> > at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:659)
> >> at
> >> > org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:472)
> at
> >> >
> >>
> org.apache.solr.request.SimpleFacets.getGroupedCounts(SimpleFacets.java:692)
> >> > at
> >> >
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:476)
> >> > at
> >> >
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:405)
> >> > at
> >> >
> >>
> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:803)
> >> >
> >> > It Only appear in case when we facet on group query normal facet works
> >> fine
> >> >
> >> > Also appears only when we atomically update the document.
> >>
> >> These errors look like problems that appear when you *change* the
> >> schema, but try to use that new schema with an existing Lucene index
> >> directory.  As Erick already mentioned, certain changes in the schema
> >> *require* completely deleting the index directory and
> >> restarting/reloading, or starting with a brand new index.  Deleting all
> >> documents instead of wiping out the index may leave Lucene remnants with
> >> incorrect metadata for the new schema.
> >>
> >> What you've said elsewhere in the thread is that you're starting with a
> >> brand new collection ... but the error messages suggest that we're still
> >> dealing with an index where you had one schema setting, indexed some
> >> data, then changed the schema without completely wiping out the index
> >> from the disk.
> >>
> >> Thanks,
> >> Shawn
> >>
> >>
>

Re: Facet is not working while querying with group

Posted by Erick Erickson <er...@gmail.com>.
OK, new collection.

1> With schemaless? When you add a document in schemaless mode, it
makes some guesses that may not play nice later.

2> Are you storing the _destination_ of any copyField? Atomic updates
do odd things if you set stored="true" for fields that are
destinations for atomic updates, specifically accumulate values in
them. You should set stored="false" for all destinations of copyField
directives.

Best,
Erick

On Fri, Jun 23, 2017 at 9:23 AM, Aman Deep Singh
<am...@gmail.com> wrote:
> No Shawn,
> I download the latest solr again then run without installing by command
> ./bin/solr -c
> after upload the fresh configset and create the new collection
> Then create a single document in solr
> after do atomic update
> and the same error occurs again.
>
>
> On Fri, Jun 23, 2017 at 7:53 PM Shawn Heisey <ap...@elyograg.org> wrote:
>
>> On 6/20/2017 11:01 PM, Aman Deep Singh wrote:
>> > If I am using docValues=false getting this exception
>> > java.lang.IllegalStateException: Type mismatch: isBlibliShipping was
>> > indexed with multiple values per document, use SORTED_SET instead at
>> >
>> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.createValue(FieldCacheImpl.java:799)
>> > at
>> >
>> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(FieldCacheImpl.java:187)
>> > at
>> >
>> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:767)
>> > at
>> >
>> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:747)
>> > at
>> > But if docValues=true then getting this error
>> > java.lang.IllegalStateException: unexpected docvalues type NUMERIC for
>> > field 'isBlibliShipping' (expected=SORTED). Re-index with correct
>> docvalues
>> > type. at org.apache.lucene.index.DocValues.checkField(DocValues.java:212)
>> > at org.apache.lucene.index.DocValues.getSorted(DocValues.java:264) at
>> >
>> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.doSetNextReader(TermGroupFacetCollector.java:129)
>> > at
>> >
>> org.apache.lucene.search.SimpleCollector.getLeafCollector(SimpleCollector.java:33)
>> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:659)
>> at
>> > org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:472) at
>> >
>> org.apache.solr.request.SimpleFacets.getGroupedCounts(SimpleFacets.java:692)
>> > at
>> > org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:476)
>> > at
>> > org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:405)
>> > at
>> >
>> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:803)
>> >
>> > It Only appear in case when we facet on group query normal facet works
>> fine
>> >
>> > Also appears only when we atomically update the document.
>>
>> These errors look like problems that appear when you *change* the
>> schema, but try to use that new schema with an existing Lucene index
>> directory.  As Erick already mentioned, certain changes in the schema
>> *require* completely deleting the index directory and
>> restarting/reloading, or starting with a brand new index.  Deleting all
>> documents instead of wiping out the index may leave Lucene remnants with
>> incorrect metadata for the new schema.
>>
>> What you've said elsewhere in the thread is that you're starting with a
>> brand new collection ... but the error messages suggest that we're still
>> dealing with an index where you had one schema setting, indexed some
>> data, then changed the schema without completely wiping out the index
>> from the disk.
>>
>> Thanks,
>> Shawn
>>
>>

Re: Facet is not working while querying with group

Posted by Aman Deep Singh <am...@gmail.com>.
No Shawn,
I download the latest solr again then run without installing by command
./bin/solr -c
after upload the fresh configset and create the new collection
Then create a single document in solr
after do atomic update
and the same error occurs again.


On Fri, Jun 23, 2017 at 7:53 PM Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/20/2017 11:01 PM, Aman Deep Singh wrote:
> > If I am using docValues=false getting this exception
> > java.lang.IllegalStateException: Type mismatch: isBlibliShipping was
> > indexed with multiple values per document, use SORTED_SET instead at
> >
> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.createValue(FieldCacheImpl.java:799)
> > at
> >
> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(FieldCacheImpl.java:187)
> > at
> >
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:767)
> > at
> >
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:747)
> > at
> > But if docValues=true then getting this error
> > java.lang.IllegalStateException: unexpected docvalues type NUMERIC for
> > field 'isBlibliShipping' (expected=SORTED). Re-index with correct
> docvalues
> > type. at org.apache.lucene.index.DocValues.checkField(DocValues.java:212)
> > at org.apache.lucene.index.DocValues.getSorted(DocValues.java:264) at
> >
> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.doSetNextReader(TermGroupFacetCollector.java:129)
> > at
> >
> org.apache.lucene.search.SimpleCollector.getLeafCollector(SimpleCollector.java:33)
> > at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:659)
> at
> > org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:472) at
> >
> org.apache.solr.request.SimpleFacets.getGroupedCounts(SimpleFacets.java:692)
> > at
> > org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:476)
> > at
> > org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:405)
> > at
> >
> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:803)
> >
> > It Only appear in case when we facet on group query normal facet works
> fine
> >
> > Also appears only when we atomically update the document.
>
> These errors look like problems that appear when you *change* the
> schema, but try to use that new schema with an existing Lucene index
> directory.  As Erick already mentioned, certain changes in the schema
> *require* completely deleting the index directory and
> restarting/reloading, or starting with a brand new index.  Deleting all
> documents instead of wiping out the index may leave Lucene remnants with
> incorrect metadata for the new schema.
>
> What you've said elsewhere in the thread is that you're starting with a
> brand new collection ... but the error messages suggest that we're still
> dealing with an index where you had one schema setting, indexed some
> data, then changed the schema without completely wiping out the index
> from the disk.
>
> Thanks,
> Shawn
>
>

Re: Facet is not working while querying with group

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/20/2017 11:01 PM, Aman Deep Singh wrote:
> If I am using docValues=false getting this exception
> java.lang.IllegalStateException: Type mismatch: isBlibliShipping was
> indexed with multiple values per document, use SORTED_SET instead at
> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.createValue(FieldCacheImpl.java:799)
> at
> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(FieldCacheImpl.java:187)
> at
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:767)
> at
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:747)
> at
> But if docValues=true then getting this error
> java.lang.IllegalStateException: unexpected docvalues type NUMERIC for
> field 'isBlibliShipping' (expected=SORTED). Re-index with correct docvalues
> type. at org.apache.lucene.index.DocValues.checkField(DocValues.java:212)
> at org.apache.lucene.index.DocValues.getSorted(DocValues.java:264) at
> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.doSetNextReader(TermGroupFacetCollector.java:129)
> at
> org.apache.lucene.search.SimpleCollector.getLeafCollector(SimpleCollector.java:33)
> at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:659) at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:472) at
> org.apache.solr.request.SimpleFacets.getGroupedCounts(SimpleFacets.java:692)
> at
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:476)
> at
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:405)
> at
> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:803)
>
> It Only appear in case when we facet on group query normal facet works fine
>
> Also appears only when we atomically update the document.

These errors look like problems that appear when you *change* the
schema, but try to use that new schema with an existing Lucene index
directory.  As Erick already mentioned, certain changes in the schema
*require* completely deleting the index directory and
restarting/reloading, or starting with a brand new index.  Deleting all
documents instead of wiping out the index may leave Lucene remnants with
incorrect metadata for the new schema.

What you've said elsewhere in the thread is that you're starting with a
brand new collection ... but the error messages suggest that we're still
dealing with an index where you had one schema setting, indexed some
data, then changed the schema without completely wiping out the index
from the disk.

Thanks,
Shawn


Re: Facet is not working while querying with group

Posted by Aman Deep Singh <am...@gmail.com>.
Hi Shawn,
If I am using docValues=false getting this exception
java.lang.IllegalStateException: Type mismatch: isBlibliShipping was
indexed with multiple values per document, use SORTED_SET instead at
org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.createValue(FieldCacheImpl.java:799)
at
org.apache.solr.uninverting.FieldCacheImpl$Cache.get(FieldCacheImpl.java:187)
at
org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:767)
at
org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:747)
at
But if docValues=true then getting this error
java.lang.IllegalStateException: unexpected docvalues type NUMERIC for
field 'isBlibliShipping' (expected=SORTED). Re-index with correct docvalues
type. at org.apache.lucene.index.DocValues.checkField(DocValues.java:212)
at org.apache.lucene.index.DocValues.getSorted(DocValues.java:264) at
org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.doSetNextReader(TermGroupFacetCollector.java:129)
at
org.apache.lucene.search.SimpleCollector.getLeafCollector(SimpleCollector.java:33)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:659) at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:472) at
org.apache.solr.request.SimpleFacets.getGroupedCounts(SimpleFacets.java:692)
at
org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:476)
at
org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:405)
at
org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:803)

It Only appear in case when we facet on group query normal facet works fine

Also appears only when we atomically update the document.





On Tue, Jun 20, 2017 at 5:46 PM Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/20/2017 12:07 AM, Aman Deep Singh wrote:
> > Again the same problem started to occur and I haven't change any schema
> > It's only coming to the Numeric data types only (tint,tdouble) and that
> too
> > in group query only
> > If I search with string field type it works fine.
> >
> > Steps which i have followed
> >
> >    1. drop the old collection
> >    2. create the new Collection
> >    3. Do the full reindex
> >    4. do atomic update on some fields multiple times
>
> If you're getting exactly the same error (Type mismatch:
> isBlibliShipping was indexed with multiple values per document, use
> SORTED_SET instead), then it means the schema on the index is changing
> after you have indexed data, in a way that won't work -- probably by
> changing multiValued or docValues.
>
> Thanks,
> Shawn
>
>

Re: Facet is not working while querying with group

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/20/2017 12:07 AM, Aman Deep Singh wrote:
> Again the same problem started to occur and I haven't change any schema
> It's only coming to the Numeric data types only (tint,tdouble) and that too
> in group query only
> If I search with string field type it works fine.
>
> Steps which i have followed
>
>    1. drop the old collection
>    2. create the new Collection
>    3. Do the full reindex
>    4. do atomic update on some fields multiple times

If you're getting exactly the same error (Type mismatch:
isBlibliShipping was indexed with multiple values per document, use
SORTED_SET instead), then it means the schema on the index is changing
after you have indexed data, in a way that won't work -- probably by
changing multiValued or docValues.

Thanks,
Shawn


Re: Facet is not working while querying with group

Posted by Aman Deep Singh <am...@gmail.com>.
Again the same problem started to occur and I haven't change any schema
It's only coming to the Numeric data types only (tint,tdouble) and that too
in group query only
If I search with string field type it works fine.

Steps which i have followed

   1. drop the old collection
   2. create the new Collection
   3. Do the full reindex
   4. do atomic update on some fields multiple times




On Mon, Jun 19, 2017 at 8:55 PM Erick Erickson <er...@gmail.com>
wrote:

> bq: Is their any roadmap to avoid the remanent data issue,
>
> Not that I've ever heard of. Well, Uwe did show a process for adding
> docValues to an existing index here:
>
> http://lucene.472066.n3.nabble.com/Adding-Docvalues-to-a-Field-td4333503.html
> but you can see what kinds of deep-level Lucene knowledge are
> necessary.
>
> From my perspective, you'll _have_ to reindex multiple times as your
> app evolves. The product managers will want new capabilities for
> instance. The incoming data will change, whatever. You simply must be
> prepared for this.
>
> And you _really_ need to spend time up front getting the first cut
> right. I flat guarantee you'll re-index multiple times in the process.
> Unless and until you have a very thorough understanding of when it's
> really necessary, just completely blow away your index and re-index
> whenever you change you schema. Oh, there's one safe operation, adding
> a completely new fieldType or field. But _changing_ either one is
> chancy.
>
> Best,
> Erick
>
> On Mon, Jun 19, 2017 at 5:34 AM, Aman Deep Singh
> <am...@gmail.com> wrote:
> > I tried to recreate the collection and its working fine,
> > But if i try to change the any field level value this error again comes
> > Is their any roadmap to avoid the remanent data issue, since every time
> you
> > change the field definition you need to delete the data directory or
> > recreate the collection.
> >
> > On Fri, Jun 16, 2017 at 11:51 PM Erick Erickson <erickerickson@gmail.com
> >
> > wrote:
> >
> >> bq: But I only changed the docvalues not the multivalued
> >>
> >> It's the same issue. There is remnant metadata when you change whether
> >> a field uses docValues or not. The error message can be ambiguous
> >> depending on where the issue is encountered.
> >>
> >> Best,
> >> Erick
> >>
> >> On Fri, Jun 16, 2017 at 9:28 AM, Aman Deep Singh
> >> <am...@gmail.com> wrote:
> >> > But I only changed the docvalues not the multivalued ,
> >> > Anyway I will try to reproduce this by deleting the entire data
> directory
> >> >
> >> > On 16-Jun-2017 9:52 PM, "Erick Erickson" <er...@gmail.com>
> >> wrote:
> >> >
> >> >> bq: deleted entire index from the solr by delete by query command
> >> >>
> >> >> That's not what I meant. Either
> >> >> a> create an entirely new collection starting with the modified
> schema
> >> >> or
> >> >> b> shut down all your Solr instances. Go into each replica/core and
> >> >> 'rm -rf data'. Restart Solr.
> >> >>
> >> >> That way you're absolutely sure everything's gone.
> >> >>
> >> >> Best,
> >> >> Erick
> >> >>
> >> >> On Fri, Jun 16, 2017 at 9:10 AM, Aman Deep Singh
> >> >> <am...@gmail.com> wrote:
> >> >> > Yes ,it was a new schema(new collection),and after that I change
> only
> >> >> > docvalues= true using schema api,but before changing the schema I
> have
> >> >> > deleted entire index from the solr by delete by query command using
> >> admin
> >> >> > gui.
> >> >> >
> >> >> > On 16-Jun-2017 9:28 PM, "Erick Erickson" <er...@gmail.com>
> >> >> wrote:
> >> >> >
> >> >> > My guess is you changed the definition of the field from
> >> >> > multiValued="true" to "false" at some point. Even if you re-index
> all
> >> >> > docs, some of the metadata can still be present.
> >> >> >
> >> >> > Did yo completely blow away the data? By that I mean remove the
> entire
> >> >> > data dir (i.e. the parent of the "index" directory) (stand alone)
> or
> >> >> > create a new collection (SolrCloud)?
> >> >> >
> >> >> > Best,
> >> >> > Erick
> >> >> >
> >> >> > On Fri, Jun 16, 2017 at 1:39 AM, Aman Deep Singh
> >> >> > <am...@gmail.com> wrote:
> >> >> >> Hi,
> >> >> >> Facets are not working when i'm querying with group command
> >> >> >> request-
> >> >> >> facet.field=isBlibliShipping&facet=true&group.facet=true&
> >> >> > group.field=productCode&group=true&indent=on&q=*:*&wt=json
> >> >> >>
> >> >> >> Schema for facet field
> >> >> >> <field name="isBlibliShipping" type="tint" docValues="true"
> >> multiValued=
> >> >> >> "false" indexed="true"stored="true"/>
> >> >> >>
> >> >> >> It was throwing error stating
> >> >> >> Type mismatch: isBlibliShipping was indexed with multiple values
> per
> >> >> >> document, use SORTED_SET instead
> >> >> >>
> >> >> >> The full stacktrace is attached as below
> >> >> >> 2017-06-16 08:20:47.367 INFO  (qtp1205044462-12)
> [c:productCollection
> >> >> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> >> >> >> o.a.s.c.S.Request [productCollection_shard1_replica1]
> webapp=/solr
> >> >> >> path=/select
> >> >> >> params={q=*:*&facet.field=isBlibliShipping&indent=on&
> >> >> > group.facet=true&facet=true&wt=json&group.field=
> >> >> productCode&_=1497601224212&
> >> >> > group=true}
> >> >> >> hits=5346 status=500 QTime=29
> >> >> >> 2017-06-16 08:20:47.369 ERROR (qtp1205044462-12)
> [c:productCollection
> >> >> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> >> >> >> o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException:
> >> >> *Exception
> >> >> >> during facet.field: isBlibliShipping*
> >> >> >>     at
> >> >> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
> >> >> > SimpleFacets.java:809)
> >> >> >>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> >> >> >>     at org.apache.solr.request.SimpleFacets$3.execute(
> >> >> > SimpleFacets.java:742)
> >> >> >>     at
> >> >> >> org.apache.solr.request.SimpleFacets.getFacetFieldCounts(
> >> >> > SimpleFacets.java:818)
> >> >> >>     at
> >> >> >> org.apache.solr.handler.component.FacetComponent.
> >> >> > getFacetCounts(FacetComponent.java:330)
> >> >> >>     at
> >> >> >> org.apache.solr.handler.component.FacetComponent.
> >> >> > process(FacetComponent.java:274)
> >> >> >>     at
> >> >> >> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
> >> >> > SearchHandler.java:296)
> >> >> >>     at
> >> >> >> org.apache.solr.handler.RequestHandlerBase.handleRequest(
> >> >> > RequestHandlerBase.java:173)
> >> >> >>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
> >> >> >>     at org.apache.solr.servlet.HttpSolrCall.execute(
> >> >> HttpSolrCall.java:723)
> >> >> >>     at
> >> org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
> >> >> >>     at
> >> >> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> >> >> > SolrDispatchFilter.java:361)
> >> >> >>     at
> >> >> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> >> >> > SolrDispatchFilter.java:305)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> >> >> > doFilter(ServletHandler.java:1691)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.servlet.ServletHandler.doHandle(
> >> >> ServletHandler.java:582)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> >> >> > ScopedHandler.java:143)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.security.SecurityHandler.handle(
> >> >> > SecurityHandler.java:548)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.session.SessionHandler.
> >> >> > doHandle(SessionHandler.java:226)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.handler.ContextHandler.
> >> >> > doHandle(ContextHandler.java:1180)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.servlet.ServletHandler.doScope(
> >> >> ServletHandler.java:512)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.session.SessionHandler.
> >> >> > doScope(SessionHandler.java:185)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.handler.ContextHandler.
> >> >> > doScope(ContextHandler.java:1112)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> >> >> > ScopedHandler.java:141)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
> >> >> > ContextHandlerCollection.java:213)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.handler.HandlerCollection.
> >> >> > handle(HandlerCollection.java:119)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> >> >> > HandlerWrapper.java:134)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
> >> >> > RewriteHandler.java:335)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> >> >> > HandlerWrapper.java:134)
> >> >> >>     at org.eclipse.jetty.server.Server.handle(Server.java:534)
> >> >> >>     at org.eclipse.jetty.server.HttpChannel.handle(
> >> >> HttpChannel.java:320)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.server.HttpConnection.onFillable(
> >> >> > HttpConnection.java:251)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(
> >> >> > AbstractConnection.java:273)
> >> >> >>     at org.eclipse.jetty.io
> >> .FillInterest.fillable(FillInterest.java:95)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(
> >> >> > SelectChannelEndPoint.java:93)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> >> >> > executeProduceConsume(ExecuteProduceConsume.java:303)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> >> >> > produceConsume(ExecuteProduceConsume.java:148)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(
> >> >> > ExecuteProduceConsume.java:136)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
> >> >> > QueuedThreadPool.java:671)
> >> >> >>     at
> >> >> >> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(
> >> >> > QueuedThreadPool.java:589)
> >> >> >>     at java.lang.Thread.run(Thread.java:745)
> >> >> >> Caused by: *java.lang.IllegalStateException: Type mismatch:
> >> >> >> isBlibliShipping was indexed with multiple values per document,
> use
> >> >> >> SORTED_SET instead*
> >> >> >>     at
> >> >> >> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.
> >> >> > createValue(FieldCacheImpl.java:799)
> >> >> >>     at
> >> >> >> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(
> >> >> > FieldCacheImpl.java:187)
> >> >> >>     at
> >> >> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
> >> >> > FieldCacheImpl.java:767)
> >> >> >>     at
> >> >> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
> >> >> > FieldCacheImpl.java:747)
> >> >> >>     at
> >> >> >> org.apache.solr.uninverting.UninvertingReader.getSortedDocValues(
> >> >> > UninvertingReader.java:319)
> >> >> >>     at
> >> org.apache.lucene.index.DocValues.getSorted(DocValues.java:262)
> >> >> >>     at
> >> >> >> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.
> >> >> > doSetNextReader(TermGroupFacetCollector.java:129)
> >> >> >>     at
> >> >> >> org.apache.lucene.search.SimpleCollector.getLeafCollector(
> >> >> > SimpleCollector.java:33)
> >> >> >>     at
> >> >> >>
> org.apache.solr.request.SimpleFacets$2.getLeafCollector(SimpleFacets.
> >> >> > java:730)
> >> >> >>     at org.apache.lucene.search.IndexSearcher.search(
> >> >> > IndexSearcher.java:659)
> >> >> >>     at org.apache.lucene.search.IndexSearcher.search(
> >> >> > IndexSearcher.java:472)
> >> >> >>     at
> >> >> >> org.apache.solr.request.SimpleFacets.getGroupedCounts(
> >> >> > SimpleFacets.java:692)
> >> >> >>     at
> >> >> >> org.apache.solr.request.SimpleFacets.getTermCounts(
> >> >> SimpleFacets.java:476)
> >> >> >>     at
> >> >> >> org.apache.solr.request.SimpleFacets.getTermCounts(
> >> >> SimpleFacets.java:405)
> >> >> >>     at
> >> >> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
> >> >> > SimpleFacets.java:803)
> >> >> >>     ... 39 more
> >> >> >>
> >> >> >> However if I try to query without grouping it is working fine.
> >> >> >> Any Idea how to fix this.
> >> >> >>
> >> >> >> Thanks,
> >> >> >> Aman Deep Singh
> >> >>
> >>
>

Re: Facet is not working while querying with group

Posted by Erick Erickson <er...@gmail.com>.
bq: Is their any roadmap to avoid the remanent data issue,

Not that I've ever heard of. Well, Uwe did show a process for adding
docValues to an existing index here:
http://lucene.472066.n3.nabble.com/Adding-Docvalues-to-a-Field-td4333503.html
but you can see what kinds of deep-level Lucene knowledge are
necessary.

From my perspective, you'll _have_ to reindex multiple times as your
app evolves. The product managers will want new capabilities for
instance. The incoming data will change, whatever. You simply must be
prepared for this.

And you _really_ need to spend time up front getting the first cut
right. I flat guarantee you'll re-index multiple times in the process.
Unless and until you have a very thorough understanding of when it's
really necessary, just completely blow away your index and re-index
whenever you change you schema. Oh, there's one safe operation, adding
a completely new fieldType or field. But _changing_ either one is
chancy.

Best,
Erick

On Mon, Jun 19, 2017 at 5:34 AM, Aman Deep Singh
<am...@gmail.com> wrote:
> I tried to recreate the collection and its working fine,
> But if i try to change the any field level value this error again comes
> Is their any roadmap to avoid the remanent data issue, since every time you
> change the field definition you need to delete the data directory or
> recreate the collection.
>
> On Fri, Jun 16, 2017 at 11:51 PM Erick Erickson <er...@gmail.com>
> wrote:
>
>> bq: But I only changed the docvalues not the multivalued
>>
>> It's the same issue. There is remnant metadata when you change whether
>> a field uses docValues or not. The error message can be ambiguous
>> depending on where the issue is encountered.
>>
>> Best,
>> Erick
>>
>> On Fri, Jun 16, 2017 at 9:28 AM, Aman Deep Singh
>> <am...@gmail.com> wrote:
>> > But I only changed the docvalues not the multivalued ,
>> > Anyway I will try to reproduce this by deleting the entire data directory
>> >
>> > On 16-Jun-2017 9:52 PM, "Erick Erickson" <er...@gmail.com>
>> wrote:
>> >
>> >> bq: deleted entire index from the solr by delete by query command
>> >>
>> >> That's not what I meant. Either
>> >> a> create an entirely new collection starting with the modified schema
>> >> or
>> >> b> shut down all your Solr instances. Go into each replica/core and
>> >> 'rm -rf data'. Restart Solr.
>> >>
>> >> That way you're absolutely sure everything's gone.
>> >>
>> >> Best,
>> >> Erick
>> >>
>> >> On Fri, Jun 16, 2017 at 9:10 AM, Aman Deep Singh
>> >> <am...@gmail.com> wrote:
>> >> > Yes ,it was a new schema(new collection),and after that I change only
>> >> > docvalues= true using schema api,but before changing the schema I have
>> >> > deleted entire index from the solr by delete by query command using
>> admin
>> >> > gui.
>> >> >
>> >> > On 16-Jun-2017 9:28 PM, "Erick Erickson" <er...@gmail.com>
>> >> wrote:
>> >> >
>> >> > My guess is you changed the definition of the field from
>> >> > multiValued="true" to "false" at some point. Even if you re-index all
>> >> > docs, some of the metadata can still be present.
>> >> >
>> >> > Did yo completely blow away the data? By that I mean remove the entire
>> >> > data dir (i.e. the parent of the "index" directory) (stand alone) or
>> >> > create a new collection (SolrCloud)?
>> >> >
>> >> > Best,
>> >> > Erick
>> >> >
>> >> > On Fri, Jun 16, 2017 at 1:39 AM, Aman Deep Singh
>> >> > <am...@gmail.com> wrote:
>> >> >> Hi,
>> >> >> Facets are not working when i'm querying with group command
>> >> >> request-
>> >> >> facet.field=isBlibliShipping&facet=true&group.facet=true&
>> >> > group.field=productCode&group=true&indent=on&q=*:*&wt=json
>> >> >>
>> >> >> Schema for facet field
>> >> >> <field name="isBlibliShipping" type="tint" docValues="true"
>> multiValued=
>> >> >> "false" indexed="true"stored="true"/>
>> >> >>
>> >> >> It was throwing error stating
>> >> >> Type mismatch: isBlibliShipping was indexed with multiple values per
>> >> >> document, use SORTED_SET instead
>> >> >>
>> >> >> The full stacktrace is attached as below
>> >> >> 2017-06-16 08:20:47.367 INFO  (qtp1205044462-12) [c:productCollection
>> >> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
>> >> >> o.a.s.c.S.Request [productCollection_shard1_replica1]  webapp=/solr
>> >> >> path=/select
>> >> >> params={q=*:*&facet.field=isBlibliShipping&indent=on&
>> >> > group.facet=true&facet=true&wt=json&group.field=
>> >> productCode&_=1497601224212&
>> >> > group=true}
>> >> >> hits=5346 status=500 QTime=29
>> >> >> 2017-06-16 08:20:47.369 ERROR (qtp1205044462-12) [c:productCollection
>> >> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
>> >> >> o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException:
>> >> *Exception
>> >> >> during facet.field: isBlibliShipping*
>> >> >>     at
>> >> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
>> >> > SimpleFacets.java:809)
>> >> >>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> >> >>     at org.apache.solr.request.SimpleFacets$3.execute(
>> >> > SimpleFacets.java:742)
>> >> >>     at
>> >> >> org.apache.solr.request.SimpleFacets.getFacetFieldCounts(
>> >> > SimpleFacets.java:818)
>> >> >>     at
>> >> >> org.apache.solr.handler.component.FacetComponent.
>> >> > getFacetCounts(FacetComponent.java:330)
>> >> >>     at
>> >> >> org.apache.solr.handler.component.FacetComponent.
>> >> > process(FacetComponent.java:274)
>> >> >>     at
>> >> >> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
>> >> > SearchHandler.java:296)
>> >> >>     at
>> >> >> org.apache.solr.handler.RequestHandlerBase.handleRequest(
>> >> > RequestHandlerBase.java:173)
>> >> >>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
>> >> >>     at org.apache.solr.servlet.HttpSolrCall.execute(
>> >> HttpSolrCall.java:723)
>> >> >>     at
>> org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
>> >> >>     at
>> >> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>> >> > SolrDispatchFilter.java:361)
>> >> >>     at
>> >> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>> >> > SolrDispatchFilter.java:305)
>> >> >>     at
>> >> >> org.eclipse.jetty.servlet.ServletHandler$CachedChain.
>> >> > doFilter(ServletHandler.java:1691)
>> >> >>     at
>> >> >> org.eclipse.jetty.servlet.ServletHandler.doHandle(
>> >> ServletHandler.java:582)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
>> >> > ScopedHandler.java:143)
>> >> >>     at
>> >> >> org.eclipse.jetty.security.SecurityHandler.handle(
>> >> > SecurityHandler.java:548)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.session.SessionHandler.
>> >> > doHandle(SessionHandler.java:226)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.handler.ContextHandler.
>> >> > doHandle(ContextHandler.java:1180)
>> >> >>     at
>> >> >> org.eclipse.jetty.servlet.ServletHandler.doScope(
>> >> ServletHandler.java:512)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.session.SessionHandler.
>> >> > doScope(SessionHandler.java:185)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.handler.ContextHandler.
>> >> > doScope(ContextHandler.java:1112)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
>> >> > ScopedHandler.java:141)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
>> >> > ContextHandlerCollection.java:213)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.handler.HandlerCollection.
>> >> > handle(HandlerCollection.java:119)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
>> >> > HandlerWrapper.java:134)
>> >> >>     at
>> >> >> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
>> >> > RewriteHandler.java:335)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
>> >> > HandlerWrapper.java:134)
>> >> >>     at org.eclipse.jetty.server.Server.handle(Server.java:534)
>> >> >>     at org.eclipse.jetty.server.HttpChannel.handle(
>> >> HttpChannel.java:320)
>> >> >>     at
>> >> >> org.eclipse.jetty.server.HttpConnection.onFillable(
>> >> > HttpConnection.java:251)
>> >> >>     at
>> >> >> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(
>> >> > AbstractConnection.java:273)
>> >> >>     at org.eclipse.jetty.io
>> .FillInterest.fillable(FillInterest.java:95)
>> >> >>     at
>> >> >> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(
>> >> > SelectChannelEndPoint.java:93)
>> >> >>     at
>> >> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
>> >> > executeProduceConsume(ExecuteProduceConsume.java:303)
>> >> >>     at
>> >> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
>> >> > produceConsume(ExecuteProduceConsume.java:148)
>> >> >>     at
>> >> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(
>> >> > ExecuteProduceConsume.java:136)
>> >> >>     at
>> >> >> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
>> >> > QueuedThreadPool.java:671)
>> >> >>     at
>> >> >> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(
>> >> > QueuedThreadPool.java:589)
>> >> >>     at java.lang.Thread.run(Thread.java:745)
>> >> >> Caused by: *java.lang.IllegalStateException: Type mismatch:
>> >> >> isBlibliShipping was indexed with multiple values per document, use
>> >> >> SORTED_SET instead*
>> >> >>     at
>> >> >> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.
>> >> > createValue(FieldCacheImpl.java:799)
>> >> >>     at
>> >> >> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(
>> >> > FieldCacheImpl.java:187)
>> >> >>     at
>> >> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
>> >> > FieldCacheImpl.java:767)
>> >> >>     at
>> >> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
>> >> > FieldCacheImpl.java:747)
>> >> >>     at
>> >> >> org.apache.solr.uninverting.UninvertingReader.getSortedDocValues(
>> >> > UninvertingReader.java:319)
>> >> >>     at
>> org.apache.lucene.index.DocValues.getSorted(DocValues.java:262)
>> >> >>     at
>> >> >> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.
>> >> > doSetNextReader(TermGroupFacetCollector.java:129)
>> >> >>     at
>> >> >> org.apache.lucene.search.SimpleCollector.getLeafCollector(
>> >> > SimpleCollector.java:33)
>> >> >>     at
>> >> >> org.apache.solr.request.SimpleFacets$2.getLeafCollector(SimpleFacets.
>> >> > java:730)
>> >> >>     at org.apache.lucene.search.IndexSearcher.search(
>> >> > IndexSearcher.java:659)
>> >> >>     at org.apache.lucene.search.IndexSearcher.search(
>> >> > IndexSearcher.java:472)
>> >> >>     at
>> >> >> org.apache.solr.request.SimpleFacets.getGroupedCounts(
>> >> > SimpleFacets.java:692)
>> >> >>     at
>> >> >> org.apache.solr.request.SimpleFacets.getTermCounts(
>> >> SimpleFacets.java:476)
>> >> >>     at
>> >> >> org.apache.solr.request.SimpleFacets.getTermCounts(
>> >> SimpleFacets.java:405)
>> >> >>     at
>> >> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
>> >> > SimpleFacets.java:803)
>> >> >>     ... 39 more
>> >> >>
>> >> >> However if I try to query without grouping it is working fine.
>> >> >> Any Idea how to fix this.
>> >> >>
>> >> >> Thanks,
>> >> >> Aman Deep Singh
>> >>
>>

Re: Facet is not working while querying with group

Posted by Aman Deep Singh <am...@gmail.com>.
I tried to recreate the collection and its working fine,
But if i try to change the any field level value this error again comes
Is their any roadmap to avoid the remanent data issue, since every time you
change the field definition you need to delete the data directory or
recreate the collection.

On Fri, Jun 16, 2017 at 11:51 PM Erick Erickson <er...@gmail.com>
wrote:

> bq: But I only changed the docvalues not the multivalued
>
> It's the same issue. There is remnant metadata when you change whether
> a field uses docValues or not. The error message can be ambiguous
> depending on where the issue is encountered.
>
> Best,
> Erick
>
> On Fri, Jun 16, 2017 at 9:28 AM, Aman Deep Singh
> <am...@gmail.com> wrote:
> > But I only changed the docvalues not the multivalued ,
> > Anyway I will try to reproduce this by deleting the entire data directory
> >
> > On 16-Jun-2017 9:52 PM, "Erick Erickson" <er...@gmail.com>
> wrote:
> >
> >> bq: deleted entire index from the solr by delete by query command
> >>
> >> That's not what I meant. Either
> >> a> create an entirely new collection starting with the modified schema
> >> or
> >> b> shut down all your Solr instances. Go into each replica/core and
> >> 'rm -rf data'. Restart Solr.
> >>
> >> That way you're absolutely sure everything's gone.
> >>
> >> Best,
> >> Erick
> >>
> >> On Fri, Jun 16, 2017 at 9:10 AM, Aman Deep Singh
> >> <am...@gmail.com> wrote:
> >> > Yes ,it was a new schema(new collection),and after that I change only
> >> > docvalues= true using schema api,but before changing the schema I have
> >> > deleted entire index from the solr by delete by query command using
> admin
> >> > gui.
> >> >
> >> > On 16-Jun-2017 9:28 PM, "Erick Erickson" <er...@gmail.com>
> >> wrote:
> >> >
> >> > My guess is you changed the definition of the field from
> >> > multiValued="true" to "false" at some point. Even if you re-index all
> >> > docs, some of the metadata can still be present.
> >> >
> >> > Did yo completely blow away the data? By that I mean remove the entire
> >> > data dir (i.e. the parent of the "index" directory) (stand alone) or
> >> > create a new collection (SolrCloud)?
> >> >
> >> > Best,
> >> > Erick
> >> >
> >> > On Fri, Jun 16, 2017 at 1:39 AM, Aman Deep Singh
> >> > <am...@gmail.com> wrote:
> >> >> Hi,
> >> >> Facets are not working when i'm querying with group command
> >> >> request-
> >> >> facet.field=isBlibliShipping&facet=true&group.facet=true&
> >> > group.field=productCode&group=true&indent=on&q=*:*&wt=json
> >> >>
> >> >> Schema for facet field
> >> >> <field name="isBlibliShipping" type="tint" docValues="true"
> multiValued=
> >> >> "false" indexed="true"stored="true"/>
> >> >>
> >> >> It was throwing error stating
> >> >> Type mismatch: isBlibliShipping was indexed with multiple values per
> >> >> document, use SORTED_SET instead
> >> >>
> >> >> The full stacktrace is attached as below
> >> >> 2017-06-16 08:20:47.367 INFO  (qtp1205044462-12) [c:productCollection
> >> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> >> >> o.a.s.c.S.Request [productCollection_shard1_replica1]  webapp=/solr
> >> >> path=/select
> >> >> params={q=*:*&facet.field=isBlibliShipping&indent=on&
> >> > group.facet=true&facet=true&wt=json&group.field=
> >> productCode&_=1497601224212&
> >> > group=true}
> >> >> hits=5346 status=500 QTime=29
> >> >> 2017-06-16 08:20:47.369 ERROR (qtp1205044462-12) [c:productCollection
> >> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> >> >> o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException:
> >> *Exception
> >> >> during facet.field: isBlibliShipping*
> >> >>     at
> >> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
> >> > SimpleFacets.java:809)
> >> >>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> >> >>     at org.apache.solr.request.SimpleFacets$3.execute(
> >> > SimpleFacets.java:742)
> >> >>     at
> >> >> org.apache.solr.request.SimpleFacets.getFacetFieldCounts(
> >> > SimpleFacets.java:818)
> >> >>     at
> >> >> org.apache.solr.handler.component.FacetComponent.
> >> > getFacetCounts(FacetComponent.java:330)
> >> >>     at
> >> >> org.apache.solr.handler.component.FacetComponent.
> >> > process(FacetComponent.java:274)
> >> >>     at
> >> >> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
> >> > SearchHandler.java:296)
> >> >>     at
> >> >> org.apache.solr.handler.RequestHandlerBase.handleRequest(
> >> > RequestHandlerBase.java:173)
> >> >>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
> >> >>     at org.apache.solr.servlet.HttpSolrCall.execute(
> >> HttpSolrCall.java:723)
> >> >>     at
> org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
> >> >>     at
> >> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> >> > SolrDispatchFilter.java:361)
> >> >>     at
> >> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> >> > SolrDispatchFilter.java:305)
> >> >>     at
> >> >> org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> >> > doFilter(ServletHandler.java:1691)
> >> >>     at
> >> >> org.eclipse.jetty.servlet.ServletHandler.doHandle(
> >> ServletHandler.java:582)
> >> >>     at
> >> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> >> > ScopedHandler.java:143)
> >> >>     at
> >> >> org.eclipse.jetty.security.SecurityHandler.handle(
> >> > SecurityHandler.java:548)
> >> >>     at
> >> >> org.eclipse.jetty.server.session.SessionHandler.
> >> > doHandle(SessionHandler.java:226)
> >> >>     at
> >> >> org.eclipse.jetty.server.handler.ContextHandler.
> >> > doHandle(ContextHandler.java:1180)
> >> >>     at
> >> >> org.eclipse.jetty.servlet.ServletHandler.doScope(
> >> ServletHandler.java:512)
> >> >>     at
> >> >> org.eclipse.jetty.server.session.SessionHandler.
> >> > doScope(SessionHandler.java:185)
> >> >>     at
> >> >> org.eclipse.jetty.server.handler.ContextHandler.
> >> > doScope(ContextHandler.java:1112)
> >> >>     at
> >> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> >> > ScopedHandler.java:141)
> >> >>     at
> >> >> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
> >> > ContextHandlerCollection.java:213)
> >> >>     at
> >> >> org.eclipse.jetty.server.handler.HandlerCollection.
> >> > handle(HandlerCollection.java:119)
> >> >>     at
> >> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> >> > HandlerWrapper.java:134)
> >> >>     at
> >> >> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
> >> > RewriteHandler.java:335)
> >> >>     at
> >> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> >> > HandlerWrapper.java:134)
> >> >>     at org.eclipse.jetty.server.Server.handle(Server.java:534)
> >> >>     at org.eclipse.jetty.server.HttpChannel.handle(
> >> HttpChannel.java:320)
> >> >>     at
> >> >> org.eclipse.jetty.server.HttpConnection.onFillable(
> >> > HttpConnection.java:251)
> >> >>     at
> >> >> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(
> >> > AbstractConnection.java:273)
> >> >>     at org.eclipse.jetty.io
> .FillInterest.fillable(FillInterest.java:95)
> >> >>     at
> >> >> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(
> >> > SelectChannelEndPoint.java:93)
> >> >>     at
> >> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> >> > executeProduceConsume(ExecuteProduceConsume.java:303)
> >> >>     at
> >> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> >> > produceConsume(ExecuteProduceConsume.java:148)
> >> >>     at
> >> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(
> >> > ExecuteProduceConsume.java:136)
> >> >>     at
> >> >> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
> >> > QueuedThreadPool.java:671)
> >> >>     at
> >> >> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(
> >> > QueuedThreadPool.java:589)
> >> >>     at java.lang.Thread.run(Thread.java:745)
> >> >> Caused by: *java.lang.IllegalStateException: Type mismatch:
> >> >> isBlibliShipping was indexed with multiple values per document, use
> >> >> SORTED_SET instead*
> >> >>     at
> >> >> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.
> >> > createValue(FieldCacheImpl.java:799)
> >> >>     at
> >> >> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(
> >> > FieldCacheImpl.java:187)
> >> >>     at
> >> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
> >> > FieldCacheImpl.java:767)
> >> >>     at
> >> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
> >> > FieldCacheImpl.java:747)
> >> >>     at
> >> >> org.apache.solr.uninverting.UninvertingReader.getSortedDocValues(
> >> > UninvertingReader.java:319)
> >> >>     at
> org.apache.lucene.index.DocValues.getSorted(DocValues.java:262)
> >> >>     at
> >> >> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.
> >> > doSetNextReader(TermGroupFacetCollector.java:129)
> >> >>     at
> >> >> org.apache.lucene.search.SimpleCollector.getLeafCollector(
> >> > SimpleCollector.java:33)
> >> >>     at
> >> >> org.apache.solr.request.SimpleFacets$2.getLeafCollector(SimpleFacets.
> >> > java:730)
> >> >>     at org.apache.lucene.search.IndexSearcher.search(
> >> > IndexSearcher.java:659)
> >> >>     at org.apache.lucene.search.IndexSearcher.search(
> >> > IndexSearcher.java:472)
> >> >>     at
> >> >> org.apache.solr.request.SimpleFacets.getGroupedCounts(
> >> > SimpleFacets.java:692)
> >> >>     at
> >> >> org.apache.solr.request.SimpleFacets.getTermCounts(
> >> SimpleFacets.java:476)
> >> >>     at
> >> >> org.apache.solr.request.SimpleFacets.getTermCounts(
> >> SimpleFacets.java:405)
> >> >>     at
> >> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
> >> > SimpleFacets.java:803)
> >> >>     ... 39 more
> >> >>
> >> >> However if I try to query without grouping it is working fine.
> >> >> Any Idea how to fix this.
> >> >>
> >> >> Thanks,
> >> >> Aman Deep Singh
> >>
>

Re: Facet is not working while querying with group

Posted by Erick Erickson <er...@gmail.com>.
bq: But I only changed the docvalues not the multivalued

It's the same issue. There is remnant metadata when you change whether
a field uses docValues or not. The error message can be ambiguous
depending on where the issue is encountered.

Best,
Erick

On Fri, Jun 16, 2017 at 9:28 AM, Aman Deep Singh
<am...@gmail.com> wrote:
> But I only changed the docvalues not the multivalued ,
> Anyway I will try to reproduce this by deleting the entire data directory
>
> On 16-Jun-2017 9:52 PM, "Erick Erickson" <er...@gmail.com> wrote:
>
>> bq: deleted entire index from the solr by delete by query command
>>
>> That's not what I meant. Either
>> a> create an entirely new collection starting with the modified schema
>> or
>> b> shut down all your Solr instances. Go into each replica/core and
>> 'rm -rf data'. Restart Solr.
>>
>> That way you're absolutely sure everything's gone.
>>
>> Best,
>> Erick
>>
>> On Fri, Jun 16, 2017 at 9:10 AM, Aman Deep Singh
>> <am...@gmail.com> wrote:
>> > Yes ,it was a new schema(new collection),and after that I change only
>> > docvalues= true using schema api,but before changing the schema I have
>> > deleted entire index from the solr by delete by query command using admin
>> > gui.
>> >
>> > On 16-Jun-2017 9:28 PM, "Erick Erickson" <er...@gmail.com>
>> wrote:
>> >
>> > My guess is you changed the definition of the field from
>> > multiValued="true" to "false" at some point. Even if you re-index all
>> > docs, some of the metadata can still be present.
>> >
>> > Did yo completely blow away the data? By that I mean remove the entire
>> > data dir (i.e. the parent of the "index" directory) (stand alone) or
>> > create a new collection (SolrCloud)?
>> >
>> > Best,
>> > Erick
>> >
>> > On Fri, Jun 16, 2017 at 1:39 AM, Aman Deep Singh
>> > <am...@gmail.com> wrote:
>> >> Hi,
>> >> Facets are not working when i'm querying with group command
>> >> request-
>> >> facet.field=isBlibliShipping&facet=true&group.facet=true&
>> > group.field=productCode&group=true&indent=on&q=*:*&wt=json
>> >>
>> >> Schema for facet field
>> >> <field name="isBlibliShipping" type="tint" docValues="true" multiValued=
>> >> "false" indexed="true"stored="true"/>
>> >>
>> >> It was throwing error stating
>> >> Type mismatch: isBlibliShipping was indexed with multiple values per
>> >> document, use SORTED_SET instead
>> >>
>> >> The full stacktrace is attached as below
>> >> 2017-06-16 08:20:47.367 INFO  (qtp1205044462-12) [c:productCollection
>> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
>> >> o.a.s.c.S.Request [productCollection_shard1_replica1]  webapp=/solr
>> >> path=/select
>> >> params={q=*:*&facet.field=isBlibliShipping&indent=on&
>> > group.facet=true&facet=true&wt=json&group.field=
>> productCode&_=1497601224212&
>> > group=true}
>> >> hits=5346 status=500 QTime=29
>> >> 2017-06-16 08:20:47.369 ERROR (qtp1205044462-12) [c:productCollection
>> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
>> >> o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException:
>> *Exception
>> >> during facet.field: isBlibliShipping*
>> >>     at
>> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
>> > SimpleFacets.java:809)
>> >>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> >>     at org.apache.solr.request.SimpleFacets$3.execute(
>> > SimpleFacets.java:742)
>> >>     at
>> >> org.apache.solr.request.SimpleFacets.getFacetFieldCounts(
>> > SimpleFacets.java:818)
>> >>     at
>> >> org.apache.solr.handler.component.FacetComponent.
>> > getFacetCounts(FacetComponent.java:330)
>> >>     at
>> >> org.apache.solr.handler.component.FacetComponent.
>> > process(FacetComponent.java:274)
>> >>     at
>> >> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
>> > SearchHandler.java:296)
>> >>     at
>> >> org.apache.solr.handler.RequestHandlerBase.handleRequest(
>> > RequestHandlerBase.java:173)
>> >>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
>> >>     at org.apache.solr.servlet.HttpSolrCall.execute(
>> HttpSolrCall.java:723)
>> >>     at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
>> >>     at
>> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>> > SolrDispatchFilter.java:361)
>> >>     at
>> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>> > SolrDispatchFilter.java:305)
>> >>     at
>> >> org.eclipse.jetty.servlet.ServletHandler$CachedChain.
>> > doFilter(ServletHandler.java:1691)
>> >>     at
>> >> org.eclipse.jetty.servlet.ServletHandler.doHandle(
>> ServletHandler.java:582)
>> >>     at
>> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
>> > ScopedHandler.java:143)
>> >>     at
>> >> org.eclipse.jetty.security.SecurityHandler.handle(
>> > SecurityHandler.java:548)
>> >>     at
>> >> org.eclipse.jetty.server.session.SessionHandler.
>> > doHandle(SessionHandler.java:226)
>> >>     at
>> >> org.eclipse.jetty.server.handler.ContextHandler.
>> > doHandle(ContextHandler.java:1180)
>> >>     at
>> >> org.eclipse.jetty.servlet.ServletHandler.doScope(
>> ServletHandler.java:512)
>> >>     at
>> >> org.eclipse.jetty.server.session.SessionHandler.
>> > doScope(SessionHandler.java:185)
>> >>     at
>> >> org.eclipse.jetty.server.handler.ContextHandler.
>> > doScope(ContextHandler.java:1112)
>> >>     at
>> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
>> > ScopedHandler.java:141)
>> >>     at
>> >> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
>> > ContextHandlerCollection.java:213)
>> >>     at
>> >> org.eclipse.jetty.server.handler.HandlerCollection.
>> > handle(HandlerCollection.java:119)
>> >>     at
>> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
>> > HandlerWrapper.java:134)
>> >>     at
>> >> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
>> > RewriteHandler.java:335)
>> >>     at
>> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
>> > HandlerWrapper.java:134)
>> >>     at org.eclipse.jetty.server.Server.handle(Server.java:534)
>> >>     at org.eclipse.jetty.server.HttpChannel.handle(
>> HttpChannel.java:320)
>> >>     at
>> >> org.eclipse.jetty.server.HttpConnection.onFillable(
>> > HttpConnection.java:251)
>> >>     at
>> >> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(
>> > AbstractConnection.java:273)
>> >>     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>> >>     at
>> >> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(
>> > SelectChannelEndPoint.java:93)
>> >>     at
>> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
>> > executeProduceConsume(ExecuteProduceConsume.java:303)
>> >>     at
>> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
>> > produceConsume(ExecuteProduceConsume.java:148)
>> >>     at
>> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(
>> > ExecuteProduceConsume.java:136)
>> >>     at
>> >> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
>> > QueuedThreadPool.java:671)
>> >>     at
>> >> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(
>> > QueuedThreadPool.java:589)
>> >>     at java.lang.Thread.run(Thread.java:745)
>> >> Caused by: *java.lang.IllegalStateException: Type mismatch:
>> >> isBlibliShipping was indexed with multiple values per document, use
>> >> SORTED_SET instead*
>> >>     at
>> >> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.
>> > createValue(FieldCacheImpl.java:799)
>> >>     at
>> >> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(
>> > FieldCacheImpl.java:187)
>> >>     at
>> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
>> > FieldCacheImpl.java:767)
>> >>     at
>> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
>> > FieldCacheImpl.java:747)
>> >>     at
>> >> org.apache.solr.uninverting.UninvertingReader.getSortedDocValues(
>> > UninvertingReader.java:319)
>> >>     at org.apache.lucene.index.DocValues.getSorted(DocValues.java:262)
>> >>     at
>> >> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.
>> > doSetNextReader(TermGroupFacetCollector.java:129)
>> >>     at
>> >> org.apache.lucene.search.SimpleCollector.getLeafCollector(
>> > SimpleCollector.java:33)
>> >>     at
>> >> org.apache.solr.request.SimpleFacets$2.getLeafCollector(SimpleFacets.
>> > java:730)
>> >>     at org.apache.lucene.search.IndexSearcher.search(
>> > IndexSearcher.java:659)
>> >>     at org.apache.lucene.search.IndexSearcher.search(
>> > IndexSearcher.java:472)
>> >>     at
>> >> org.apache.solr.request.SimpleFacets.getGroupedCounts(
>> > SimpleFacets.java:692)
>> >>     at
>> >> org.apache.solr.request.SimpleFacets.getTermCounts(
>> SimpleFacets.java:476)
>> >>     at
>> >> org.apache.solr.request.SimpleFacets.getTermCounts(
>> SimpleFacets.java:405)
>> >>     at
>> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
>> > SimpleFacets.java:803)
>> >>     ... 39 more
>> >>
>> >> However if I try to query without grouping it is working fine.
>> >> Any Idea how to fix this.
>> >>
>> >> Thanks,
>> >> Aman Deep Singh
>>

Re: Facet is not working while querying with group

Posted by Aman Deep Singh <am...@gmail.com>.
But I only changed the docvalues not the multivalued ,
Anyway I will try to reproduce this by deleting the entire data directory

On 16-Jun-2017 9:52 PM, "Erick Erickson" <er...@gmail.com> wrote:

> bq: deleted entire index from the solr by delete by query command
>
> That's not what I meant. Either
> a> create an entirely new collection starting with the modified schema
> or
> b> shut down all your Solr instances. Go into each replica/core and
> 'rm -rf data'. Restart Solr.
>
> That way you're absolutely sure everything's gone.
>
> Best,
> Erick
>
> On Fri, Jun 16, 2017 at 9:10 AM, Aman Deep Singh
> <am...@gmail.com> wrote:
> > Yes ,it was a new schema(new collection),and after that I change only
> > docvalues= true using schema api,but before changing the schema I have
> > deleted entire index from the solr by delete by query command using admin
> > gui.
> >
> > On 16-Jun-2017 9:28 PM, "Erick Erickson" <er...@gmail.com>
> wrote:
> >
> > My guess is you changed the definition of the field from
> > multiValued="true" to "false" at some point. Even if you re-index all
> > docs, some of the metadata can still be present.
> >
> > Did yo completely blow away the data? By that I mean remove the entire
> > data dir (i.e. the parent of the "index" directory) (stand alone) or
> > create a new collection (SolrCloud)?
> >
> > Best,
> > Erick
> >
> > On Fri, Jun 16, 2017 at 1:39 AM, Aman Deep Singh
> > <am...@gmail.com> wrote:
> >> Hi,
> >> Facets are not working when i'm querying with group command
> >> request-
> >> facet.field=isBlibliShipping&facet=true&group.facet=true&
> > group.field=productCode&group=true&indent=on&q=*:*&wt=json
> >>
> >> Schema for facet field
> >> <field name="isBlibliShipping" type="tint" docValues="true" multiValued=
> >> "false" indexed="true"stored="true"/>
> >>
> >> It was throwing error stating
> >> Type mismatch: isBlibliShipping was indexed with multiple values per
> >> document, use SORTED_SET instead
> >>
> >> The full stacktrace is attached as below
> >> 2017-06-16 08:20:47.367 INFO  (qtp1205044462-12) [c:productCollection
> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> >> o.a.s.c.S.Request [productCollection_shard1_replica1]  webapp=/solr
> >> path=/select
> >> params={q=*:*&facet.field=isBlibliShipping&indent=on&
> > group.facet=true&facet=true&wt=json&group.field=
> productCode&_=1497601224212&
> > group=true}
> >> hits=5346 status=500 QTime=29
> >> 2017-06-16 08:20:47.369 ERROR (qtp1205044462-12) [c:productCollection
> >> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> >> o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException:
> *Exception
> >> during facet.field: isBlibliShipping*
> >>     at
> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
> > SimpleFacets.java:809)
> >>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> >>     at org.apache.solr.request.SimpleFacets$3.execute(
> > SimpleFacets.java:742)
> >>     at
> >> org.apache.solr.request.SimpleFacets.getFacetFieldCounts(
> > SimpleFacets.java:818)
> >>     at
> >> org.apache.solr.handler.component.FacetComponent.
> > getFacetCounts(FacetComponent.java:330)
> >>     at
> >> org.apache.solr.handler.component.FacetComponent.
> > process(FacetComponent.java:274)
> >>     at
> >> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
> > SearchHandler.java:296)
> >>     at
> >> org.apache.solr.handler.RequestHandlerBase.handleRequest(
> > RequestHandlerBase.java:173)
> >>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
> >>     at org.apache.solr.servlet.HttpSolrCall.execute(
> HttpSolrCall.java:723)
> >>     at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
> >>     at
> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> > SolrDispatchFilter.java:361)
> >>     at
> >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> > SolrDispatchFilter.java:305)
> >>     at
> >> org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> > doFilter(ServletHandler.java:1691)
> >>     at
> >> org.eclipse.jetty.servlet.ServletHandler.doHandle(
> ServletHandler.java:582)
> >>     at
> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> > ScopedHandler.java:143)
> >>     at
> >> org.eclipse.jetty.security.SecurityHandler.handle(
> > SecurityHandler.java:548)
> >>     at
> >> org.eclipse.jetty.server.session.SessionHandler.
> > doHandle(SessionHandler.java:226)
> >>     at
> >> org.eclipse.jetty.server.handler.ContextHandler.
> > doHandle(ContextHandler.java:1180)
> >>     at
> >> org.eclipse.jetty.servlet.ServletHandler.doScope(
> ServletHandler.java:512)
> >>     at
> >> org.eclipse.jetty.server.session.SessionHandler.
> > doScope(SessionHandler.java:185)
> >>     at
> >> org.eclipse.jetty.server.handler.ContextHandler.
> > doScope(ContextHandler.java:1112)
> >>     at
> >> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> > ScopedHandler.java:141)
> >>     at
> >> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
> > ContextHandlerCollection.java:213)
> >>     at
> >> org.eclipse.jetty.server.handler.HandlerCollection.
> > handle(HandlerCollection.java:119)
> >>     at
> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> > HandlerWrapper.java:134)
> >>     at
> >> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
> > RewriteHandler.java:335)
> >>     at
> >> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> > HandlerWrapper.java:134)
> >>     at org.eclipse.jetty.server.Server.handle(Server.java:534)
> >>     at org.eclipse.jetty.server.HttpChannel.handle(
> HttpChannel.java:320)
> >>     at
> >> org.eclipse.jetty.server.HttpConnection.onFillable(
> > HttpConnection.java:251)
> >>     at
> >> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(
> > AbstractConnection.java:273)
> >>     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
> >>     at
> >> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(
> > SelectChannelEndPoint.java:93)
> >>     at
> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> > executeProduceConsume(ExecuteProduceConsume.java:303)
> >>     at
> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> > produceConsume(ExecuteProduceConsume.java:148)
> >>     at
> >> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(
> > ExecuteProduceConsume.java:136)
> >>     at
> >> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
> > QueuedThreadPool.java:671)
> >>     at
> >> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(
> > QueuedThreadPool.java:589)
> >>     at java.lang.Thread.run(Thread.java:745)
> >> Caused by: *java.lang.IllegalStateException: Type mismatch:
> >> isBlibliShipping was indexed with multiple values per document, use
> >> SORTED_SET instead*
> >>     at
> >> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.
> > createValue(FieldCacheImpl.java:799)
> >>     at
> >> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(
> > FieldCacheImpl.java:187)
> >>     at
> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
> > FieldCacheImpl.java:767)
> >>     at
> >> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
> > FieldCacheImpl.java:747)
> >>     at
> >> org.apache.solr.uninverting.UninvertingReader.getSortedDocValues(
> > UninvertingReader.java:319)
> >>     at org.apache.lucene.index.DocValues.getSorted(DocValues.java:262)
> >>     at
> >> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.
> > doSetNextReader(TermGroupFacetCollector.java:129)
> >>     at
> >> org.apache.lucene.search.SimpleCollector.getLeafCollector(
> > SimpleCollector.java:33)
> >>     at
> >> org.apache.solr.request.SimpleFacets$2.getLeafCollector(SimpleFacets.
> > java:730)
> >>     at org.apache.lucene.search.IndexSearcher.search(
> > IndexSearcher.java:659)
> >>     at org.apache.lucene.search.IndexSearcher.search(
> > IndexSearcher.java:472)
> >>     at
> >> org.apache.solr.request.SimpleFacets.getGroupedCounts(
> > SimpleFacets.java:692)
> >>     at
> >> org.apache.solr.request.SimpleFacets.getTermCounts(
> SimpleFacets.java:476)
> >>     at
> >> org.apache.solr.request.SimpleFacets.getTermCounts(
> SimpleFacets.java:405)
> >>     at
> >> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
> > SimpleFacets.java:803)
> >>     ... 39 more
> >>
> >> However if I try to query without grouping it is working fine.
> >> Any Idea how to fix this.
> >>
> >> Thanks,
> >> Aman Deep Singh
>

Re: Facet is not working while querying with group

Posted by Erick Erickson <er...@gmail.com>.
bq: deleted entire index from the solr by delete by query command

That's not what I meant. Either
a> create an entirely new collection starting with the modified schema
or
b> shut down all your Solr instances. Go into each replica/core and
'rm -rf data'. Restart Solr.

That way you're absolutely sure everything's gone.

Best,
Erick

On Fri, Jun 16, 2017 at 9:10 AM, Aman Deep Singh
<am...@gmail.com> wrote:
> Yes ,it was a new schema(new collection),and after that I change only
> docvalues= true using schema api,but before changing the schema I have
> deleted entire index from the solr by delete by query command using admin
> gui.
>
> On 16-Jun-2017 9:28 PM, "Erick Erickson" <er...@gmail.com> wrote:
>
> My guess is you changed the definition of the field from
> multiValued="true" to "false" at some point. Even if you re-index all
> docs, some of the metadata can still be present.
>
> Did yo completely blow away the data? By that I mean remove the entire
> data dir (i.e. the parent of the "index" directory) (stand alone) or
> create a new collection (SolrCloud)?
>
> Best,
> Erick
>
> On Fri, Jun 16, 2017 at 1:39 AM, Aman Deep Singh
> <am...@gmail.com> wrote:
>> Hi,
>> Facets are not working when i'm querying with group command
>> request-
>> facet.field=isBlibliShipping&facet=true&group.facet=true&
> group.field=productCode&group=true&indent=on&q=*:*&wt=json
>>
>> Schema for facet field
>> <field name="isBlibliShipping" type="tint" docValues="true" multiValued=
>> "false" indexed="true"stored="true"/>
>>
>> It was throwing error stating
>> Type mismatch: isBlibliShipping was indexed with multiple values per
>> document, use SORTED_SET instead
>>
>> The full stacktrace is attached as below
>> 2017-06-16 08:20:47.367 INFO  (qtp1205044462-12) [c:productCollection
>> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
>> o.a.s.c.S.Request [productCollection_shard1_replica1]  webapp=/solr
>> path=/select
>> params={q=*:*&facet.field=isBlibliShipping&indent=on&
> group.facet=true&facet=true&wt=json&group.field=productCode&_=1497601224212&
> group=true}
>> hits=5346 status=500 QTime=29
>> 2017-06-16 08:20:47.369 ERROR (qtp1205044462-12) [c:productCollection
>> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
>> o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException: *Exception
>> during facet.field: isBlibliShipping*
>>     at
>> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
> SimpleFacets.java:809)
>>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>     at org.apache.solr.request.SimpleFacets$3.execute(
> SimpleFacets.java:742)
>>     at
>> org.apache.solr.request.SimpleFacets.getFacetFieldCounts(
> SimpleFacets.java:818)
>>     at
>> org.apache.solr.handler.component.FacetComponent.
> getFacetCounts(FacetComponent.java:330)
>>     at
>> org.apache.solr.handler.component.FacetComponent.
> process(FacetComponent.java:274)
>>     at
>> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
> SearchHandler.java:296)
>>     at
>> org.apache.solr.handler.RequestHandlerBase.handleRequest(
> RequestHandlerBase.java:173)
>>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
>>     at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)
>>     at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
>>     at
>> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> SolrDispatchFilter.java:361)
>>     at
>> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> SolrDispatchFilter.java:305)
>>     at
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> doFilter(ServletHandler.java:1691)
>>     at
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
>>     at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> ScopedHandler.java:143)
>>     at
>> org.eclipse.jetty.security.SecurityHandler.handle(
> SecurityHandler.java:548)
>>     at
>> org.eclipse.jetty.server.session.SessionHandler.
> doHandle(SessionHandler.java:226)
>>     at
>> org.eclipse.jetty.server.handler.ContextHandler.
> doHandle(ContextHandler.java:1180)
>>     at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
>>     at
>> org.eclipse.jetty.server.session.SessionHandler.
> doScope(SessionHandler.java:185)
>>     at
>> org.eclipse.jetty.server.handler.ContextHandler.
> doScope(ContextHandler.java:1112)
>>     at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> ScopedHandler.java:141)
>>     at
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
> ContextHandlerCollection.java:213)
>>     at
>> org.eclipse.jetty.server.handler.HandlerCollection.
> handle(HandlerCollection.java:119)
>>     at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> HandlerWrapper.java:134)
>>     at
>> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
> RewriteHandler.java:335)
>>     at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> HandlerWrapper.java:134)
>>     at org.eclipse.jetty.server.Server.handle(Server.java:534)
>>     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
>>     at
>> org.eclipse.jetty.server.HttpConnection.onFillable(
> HttpConnection.java:251)
>>     at
>> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(
> AbstractConnection.java:273)
>>     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>>     at
>> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(
> SelectChannelEndPoint.java:93)
>>     at
>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> executeProduceConsume(ExecuteProduceConsume.java:303)
>>     at
>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> produceConsume(ExecuteProduceConsume.java:148)
>>     at
>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(
> ExecuteProduceConsume.java:136)
>>     at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
> QueuedThreadPool.java:671)
>>     at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(
> QueuedThreadPool.java:589)
>>     at java.lang.Thread.run(Thread.java:745)
>> Caused by: *java.lang.IllegalStateException: Type mismatch:
>> isBlibliShipping was indexed with multiple values per document, use
>> SORTED_SET instead*
>>     at
>> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.
> createValue(FieldCacheImpl.java:799)
>>     at
>> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(
> FieldCacheImpl.java:187)
>>     at
>> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
> FieldCacheImpl.java:767)
>>     at
>> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
> FieldCacheImpl.java:747)
>>     at
>> org.apache.solr.uninverting.UninvertingReader.getSortedDocValues(
> UninvertingReader.java:319)
>>     at org.apache.lucene.index.DocValues.getSorted(DocValues.java:262)
>>     at
>> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.
> doSetNextReader(TermGroupFacetCollector.java:129)
>>     at
>> org.apache.lucene.search.SimpleCollector.getLeafCollector(
> SimpleCollector.java:33)
>>     at
>> org.apache.solr.request.SimpleFacets$2.getLeafCollector(SimpleFacets.
> java:730)
>>     at org.apache.lucene.search.IndexSearcher.search(
> IndexSearcher.java:659)
>>     at org.apache.lucene.search.IndexSearcher.search(
> IndexSearcher.java:472)
>>     at
>> org.apache.solr.request.SimpleFacets.getGroupedCounts(
> SimpleFacets.java:692)
>>     at
>> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:476)
>>     at
>> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:405)
>>     at
>> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
> SimpleFacets.java:803)
>>     ... 39 more
>>
>> However if I try to query without grouping it is working fine.
>> Any Idea how to fix this.
>>
>> Thanks,
>> Aman Deep Singh

Re: Facet is not working while querying with group

Posted by Aman Deep Singh <am...@gmail.com>.
Yes ,it was a new schema(new collection),and after that I change only
docvalues= true using schema api,but before changing the schema I have
deleted entire index from the solr by delete by query command using admin
gui.

On 16-Jun-2017 9:28 PM, "Erick Erickson" <er...@gmail.com> wrote:

My guess is you changed the definition of the field from
multiValued="true" to "false" at some point. Even if you re-index all
docs, some of the metadata can still be present.

Did yo completely blow away the data? By that I mean remove the entire
data dir (i.e. the parent of the "index" directory) (stand alone) or
create a new collection (SolrCloud)?

Best,
Erick

On Fri, Jun 16, 2017 at 1:39 AM, Aman Deep Singh
<am...@gmail.com> wrote:
> Hi,
> Facets are not working when i'm querying with group command
> request-
> facet.field=isBlibliShipping&facet=true&group.facet=true&
group.field=productCode&group=true&indent=on&q=*:*&wt=json
>
> Schema for facet field
> <field name="isBlibliShipping" type="tint" docValues="true" multiValued=
> "false" indexed="true"stored="true"/>
>
> It was throwing error stating
> Type mismatch: isBlibliShipping was indexed with multiple values per
> document, use SORTED_SET instead
>
> The full stacktrace is attached as below
> 2017-06-16 08:20:47.367 INFO  (qtp1205044462-12) [c:productCollection
> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> o.a.s.c.S.Request [productCollection_shard1_replica1]  webapp=/solr
> path=/select
> params={q=*:*&facet.field=isBlibliShipping&indent=on&
group.facet=true&facet=true&wt=json&group.field=productCode&_=1497601224212&
group=true}
> hits=5346 status=500 QTime=29
> 2017-06-16 08:20:47.369 ERROR (qtp1205044462-12) [c:productCollection
> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException: *Exception
> during facet.field: isBlibliShipping*
>     at
> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
SimpleFacets.java:809)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>     at org.apache.solr.request.SimpleFacets$3.execute(
SimpleFacets.java:742)
>     at
> org.apache.solr.request.SimpleFacets.getFacetFieldCounts(
SimpleFacets.java:818)
>     at
> org.apache.solr.handler.component.FacetComponent.
getFacetCounts(FacetComponent.java:330)
>     at
> org.apache.solr.handler.component.FacetComponent.
process(FacetComponent.java:274)
>     at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
SearchHandler.java:296)
>     at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(
RequestHandlerBase.java:173)
>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
>     at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)
>     at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
>     at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
SolrDispatchFilter.java:361)
>     at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
SolrDispatchFilter.java:305)
>     at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.
doFilter(ServletHandler.java:1691)
>     at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
>     at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(
ScopedHandler.java:143)
>     at
> org.eclipse.jetty.security.SecurityHandler.handle(
SecurityHandler.java:548)
>     at
> org.eclipse.jetty.server.session.SessionHandler.
doHandle(SessionHandler.java:226)
>     at
> org.eclipse.jetty.server.handler.ContextHandler.
doHandle(ContextHandler.java:1180)
>     at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
>     at
> org.eclipse.jetty.server.session.SessionHandler.
doScope(SessionHandler.java:185)
>     at
> org.eclipse.jetty.server.handler.ContextHandler.
doScope(ContextHandler.java:1112)
>     at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(
ScopedHandler.java:141)
>     at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
ContextHandlerCollection.java:213)
>     at
> org.eclipse.jetty.server.handler.HandlerCollection.
handle(HandlerCollection.java:119)
>     at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
HandlerWrapper.java:134)
>     at
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
RewriteHandler.java:335)
>     at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
HandlerWrapper.java:134)
>     at org.eclipse.jetty.server.Server.handle(Server.java:534)
>     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
>     at
> org.eclipse.jetty.server.HttpConnection.onFillable(
HttpConnection.java:251)
>     at
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(
AbstractConnection.java:273)
>     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>     at
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(
SelectChannelEndPoint.java:93)
>     at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
executeProduceConsume(ExecuteProduceConsume.java:303)
>     at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
produceConsume(ExecuteProduceConsume.java:148)
>     at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(
ExecuteProduceConsume.java:136)
>     at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
QueuedThreadPool.java:671)
>     at
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(
QueuedThreadPool.java:589)
>     at java.lang.Thread.run(Thread.java:745)
> Caused by: *java.lang.IllegalStateException: Type mismatch:
> isBlibliShipping was indexed with multiple values per document, use
> SORTED_SET instead*
>     at
> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.
createValue(FieldCacheImpl.java:799)
>     at
> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(
FieldCacheImpl.java:187)
>     at
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
FieldCacheImpl.java:767)
>     at
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(
FieldCacheImpl.java:747)
>     at
> org.apache.solr.uninverting.UninvertingReader.getSortedDocValues(
UninvertingReader.java:319)
>     at org.apache.lucene.index.DocValues.getSorted(DocValues.java:262)
>     at
> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.
doSetNextReader(TermGroupFacetCollector.java:129)
>     at
> org.apache.lucene.search.SimpleCollector.getLeafCollector(
SimpleCollector.java:33)
>     at
> org.apache.solr.request.SimpleFacets$2.getLeafCollector(SimpleFacets.
java:730)
>     at org.apache.lucene.search.IndexSearcher.search(
IndexSearcher.java:659)
>     at org.apache.lucene.search.IndexSearcher.search(
IndexSearcher.java:472)
>     at
> org.apache.solr.request.SimpleFacets.getGroupedCounts(
SimpleFacets.java:692)
>     at
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:476)
>     at
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:405)
>     at
> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(
SimpleFacets.java:803)
>     ... 39 more
>
> However if I try to query without grouping it is working fine.
> Any Idea how to fix this.
>
> Thanks,
> Aman Deep Singh

Re: Facet is not working while querying with group

Posted by Erick Erickson <er...@gmail.com>.
My guess is you changed the definition of the field from
multiValued="true" to "false" at some point. Even if you re-index all
docs, some of the metadata can still be present.

Did yo completely blow away the data? By that I mean remove the entire
data dir (i.e. the parent of the "index" directory) (stand alone) or
create a new collection (SolrCloud)?

Best,
Erick

On Fri, Jun 16, 2017 at 1:39 AM, Aman Deep Singh
<am...@gmail.com> wrote:
> Hi,
> Facets are not working when i'm querying with group command
> request-
> facet.field=isBlibliShipping&facet=true&group.facet=true&group.field=productCode&group=true&indent=on&q=*:*&wt=json
>
> Schema for facet field
> <field name="isBlibliShipping" type="tint" docValues="true" multiValued=
> "false" indexed="true"stored="true"/>
>
> It was throwing error stating
> Type mismatch: isBlibliShipping was indexed with multiple values per
> document, use SORTED_SET instead
>
> The full stacktrace is attached as below
> 2017-06-16 08:20:47.367 INFO  (qtp1205044462-12) [c:productCollection
> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> o.a.s.c.S.Request [productCollection_shard1_replica1]  webapp=/solr
> path=/select
> params={q=*:*&facet.field=isBlibliShipping&indent=on&group.facet=true&facet=true&wt=json&group.field=productCode&_=1497601224212&group=true}
> hits=5346 status=500 QTime=29
> 2017-06-16 08:20:47.369 ERROR (qtp1205044462-12) [c:productCollection
> s:shard1 r:core_node1 x:productCollection_shard1_replica1]
> o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException: *Exception
> during facet.field: isBlibliShipping*
>     at
> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:809)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>     at org.apache.solr.request.SimpleFacets$3.execute(SimpleFacets.java:742)
>     at
> org.apache.solr.request.SimpleFacets.getFacetFieldCounts(SimpleFacets.java:818)
>     at
> org.apache.solr.handler.component.FacetComponent.getFacetCounts(FacetComponent.java:330)
>     at
> org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:274)
>     at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:296)
>     at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)
>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
>     at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)
>     at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
>     at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:361)
>     at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:305)
>     at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)
>     at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
>     at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>     at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
>     at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
>     at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
>     at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
>     at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
>     at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
>     at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>     at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
>     at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
>     at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
>     at
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
>     at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
>     at org.eclipse.jetty.server.Server.handle(Server.java:534)
>     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
>     at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
>     at
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
>     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>     at
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
>     at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
>     at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
>     at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
>     at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
>     at
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
>     at java.lang.Thread.run(Thread.java:745)
> Caused by: *java.lang.IllegalStateException: Type mismatch:
> isBlibliShipping was indexed with multiple values per document, use
> SORTED_SET instead*
>     at
> org.apache.solr.uninverting.FieldCacheImpl$SortedDocValuesCache.createValue(FieldCacheImpl.java:799)
>     at
> org.apache.solr.uninverting.FieldCacheImpl$Cache.get(FieldCacheImpl.java:187)
>     at
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:767)
>     at
> org.apache.solr.uninverting.FieldCacheImpl.getTermsIndex(FieldCacheImpl.java:747)
>     at
> org.apache.solr.uninverting.UninvertingReader.getSortedDocValues(UninvertingReader.java:319)
>     at org.apache.lucene.index.DocValues.getSorted(DocValues.java:262)
>     at
> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.doSetNextReader(TermGroupFacetCollector.java:129)
>     at
> org.apache.lucene.search.SimpleCollector.getLeafCollector(SimpleCollector.java:33)
>     at
> org.apache.solr.request.SimpleFacets$2.getLeafCollector(SimpleFacets.java:730)
>     at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:659)
>     at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:472)
>     at
> org.apache.solr.request.SimpleFacets.getGroupedCounts(SimpleFacets.java:692)
>     at
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:476)
>     at
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:405)
>     at
> org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:803)
>     ... 39 more
>
> However if I try to query without grouping it is working fine.
> Any Idea how to fix this.
>
> Thanks,
> Aman Deep Singh