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 Sohail Aboobaker <sa...@gmail.com> on 2012/04/26 18:45:21 UTC

Question on Facet counts by grouped results

Hi,

We have an index that contains following fields:

a. Item masterid
b. Item Level 1 Categories (multi-valued field)
c. Item Serial
d. Item description
e. Price.
and some other fields.

I am querying the by using following:

select?q=*:*&group=true&group.field=itemmasterid&group.ngroups=true&facet=true&facet.field=level1categories&group.facet=true

Test index has only 4807 items.

I get perfect counts for groups (total items 4807 and number of groups=1119).
<lst name="itemmasterid">
    <int name="matches">4807</int>
    <int name="ngroups">1119</int>
<arr name="groups">

but in the facet part, I get:
<lst name="facet_counts">
   <lst name="facet_queries"/>
     <lst name="facet_fields">
          <lst name="level1categories">
               <int name="Artists">4761</int>
               <int name="Watches">41</int>
               <int name="Jewelry">5</int>
           </lst>
       </lst>
     <lst name="facet_dates"/>
    <lst name="facet_ranges"/>
  </lst>

*************
By adding &group.facet=true, I was expecting to see counts by group
not by individual items.

What am I doing incorrectly? Or what is the way to achieve facet
counts by groups.

Thank you for your help.

Regards,
Sohail

Re: Question on Facet counts by grouped results

Posted by Sohail Aboobaker <sa...@gmail.com>.
Thanks Erick,

It works perfectly now. My purpose was to just test the group facet count
feature and that works as expected. Can't wait for this release to be out :)

Sohail

Re: Question on Facet counts by grouped results

Posted by Erick Erickson <er...@gmail.com>.
Yes, stopwords_en.txt. Or go into your schema file and find the
usages of stopwords_en.txt and change it to a  stopwords file
in your setup.

Best
Erick

On Thu, Apr 26, 2012 at 5:15 PM, Sohail Aboobaker <sa...@gmail.com> wrote:
> Hi,
>
> I am trying nightly build for solr 4.0. I downloaded the build and am
> able to start it. In 3.x, I copied the example directory and updated
> the schema.xml. It worked fine but in 4.0, I did the same thing (make
> a copy of example) but when I change the schema, I get following:
>
> Apr 26, 2012 5:04:12 PM org.apache.solr.common.SolrException log
> SEVERE: null:java.lang.RuntimeException: Can't find resource
> 'stopwords_en.txt' in classpath or 'solr/./conf/',
> cwd=/apps/servers/apache-solr-4.0-2012-04-26_08-10-58/apache-solr-4.0-2012-04-26_08-10-58/trusted
>
> Do i need to copy some other files in my copied directory as well?
>
> Sohail

Re: Question on Facet counts by grouped results

Posted by Sohail Aboobaker <sa...@gmail.com>.
I had copied the full example directory. After copying, I had replaced
schema.xml from my old 3.5 schema.xml and I faced this error. After Eric's
email, I copied stopwords_en.txt into conf directory of my copy. It works
fine after that.

After seeing your email, it seems that the better approach would be to add
lang/ infront of the stopwords_en references in my copied schema.xml
because lang/ did not exist in the 3.5 directories.

Regards
Sohail

Re: Question on Facet counts by grouped results

Posted by Chris Hostetter <ho...@fucit.org>.
: the schema.xml. It worked fine but in 4.0, I did the same thing (make
: a copy of example) but when I change the schema, I get following:
: 
: Apr 26, 2012 5:04:12 PM org.apache.solr.common.SolrException log
: SEVERE: null:java.lang.RuntimeException: Can't find resource
: 'stopwords_en.txt' in classpath or 'solr/./conf/',

you'll have to be more specific about what changes you made.

The current trunk example contains a "lang/stopwords_en.txt" file which is 
refrenced from the example schema.xml -- so depending on what changes 
you made, and wether or nor you copied the entire example/solr 
directory, you may or may not get errors...


hossman@bester:~/lucene/dev/solr/example$ find -name stopwords_en.txt
./solr/conf/lang/stopwords_en.txt
hossman@bester:~/lucene/dev/solr/example$ grep stopwords_en.txt solr/conf/schema.xml 
         (lang/stopwords_en.txt), down cases, protects words from protwords.txt, and
                words="lang/stopwords_en.txt"
                words="lang/stopwords_en.txt"
                words="lang/stopwords_en.txt"
                words="lang/stopwords_en.txt"
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt"/>


-Hoss

Re: Question on Facet counts by grouped results

Posted by Sohail Aboobaker <sa...@gmail.com>.
Hi,

I am trying nightly build for solr 4.0. I downloaded the build and am
able to start it. In 3.x, I copied the example directory and updated
the schema.xml. It worked fine but in 4.0, I did the same thing (make
a copy of example) but when I change the schema, I get following:

Apr 26, 2012 5:04:12 PM org.apache.solr.common.SolrException log
SEVERE: null:java.lang.RuntimeException: Can't find resource
'stopwords_en.txt' in classpath or 'solr/./conf/',
cwd=/apps/servers/apache-solr-4.0-2012-04-26_08-10-58/apache-solr-4.0-2012-04-26_08-10-58/trusted

Do i need to copy some other files in my copied directory as well?

Sohail

Re: Question on Facet counts by grouped results

Posted by Mark Miller <ma...@gmail.com>.
On Apr 26, 2012, at 1:24 PM, Sohail Aboobaker wrote:

>  Any
> ideas on when Solr 4.0 will be out?

We are hoping this year. There will be a series of alphas and betas that should start within a month or few.

- Mark Miller
lucidimagination.com












Re: Question on Facet counts by grouped results

Posted by Sohail Aboobaker <sa...@gmail.com>.
Never mind, I did not notice that this is coming in Solr 4.0. Any
ideas on when Solr 4.0 will be out?

Sohail