lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Solr grouping problem - need help
Date Tue, 13 Jan 2015 16:37:10 GMT
Something is very wrong here. Have you perhaps been changing your
schema without re-indexing? And I recommend you completely remove
your data directory (the one with "index" and "tlog" subdirectories) after
you change your schema.xml file.

Because you're trying to group on a field that is _not_ indexed, you
should be getting an error returned, something like:
"can not use FieldCache on a field which is neither indexed nor has
doc values: ...."

As far as the tokenization comment is, just start by making the field you want
to group on be
stored="false" indexed="true" type="string"

Best,
Erick

On Tue, Jan 13, 2015 at 5:09 AM, Naresh Yadav <nyadav.ait@gmail.com> wrote:
> Hi jack,
>
> Thanks for replying, i am new to solr please guide me on this. I have many
> such columns in my schema
> so copy field will create lot of duplicate fields beside i do not need any
> search on original field.
>
> My usecase is i do not want any search on tenant_pool field thats why i
> declared it as stored field not indexed.
> I just need to get unique values in this field. Please show some direction.
>
>
> On Tue, Jan 13, 2015 at 6:16 PM, Jack Krupansky <jack.krupansky@gmail.com>
> wrote:
>
>> That's your job. The easiest way is to do a copyField to a "string" field.
>>
>> -- Jack Krupansky
>>
>> On Tue, Jan 13, 2015 at 7:33 AM, Naresh Yadav <nyadav.ait@gmail.com>
>> wrote:
>>
>> > *Schema :*
>> > <field name="tenant_pool" type="text" stored="true"/>
>> >
>> > *Code :*
>> > SolrQuery q = new SolrQuery().setQuery("*:*");
>> > q.set(GroupParams.GROUP, true);
>> > q.set(GroupParams.GROUP_FIELD, "tenant_pool");
>> >
>> > *Data :*
>> > "tenant_pool" : "Baroda Farms"
>> > "tenant_pool" : "Ketty Farms"
>> >
>> > *Output coming :*
>> > groupValue=Farms, docs=2
>> >
>> > *Expected Output :*
>> > groupValue=Baroda Farms, docs=1
>> > groupValue=Ketty Farms, docs=1
>> >
>> > Please guide me how i can tell solr not to tokenize stored field to
>> decide
>> > unique groups..
>> >
>> > I want unique groups as exact value of field not the tokens which solr is
>> > doing
>> > currently.
>> >
>> > Thanks
>> > Naresh
>> >
>>
>
>
>
> --
> Cheers,
>
> Naresh Yadav
> +919960523401
> http://nareshyadav.blogspot.com/
> SSE, MetrixLine Inc.

Mime
View raw message