lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaushik Chakraborty <kaych...@gmail.com>
Subject Faceting on multivalued field
Date Sun, 03 Apr 2011 18:31:02 GMT
Hi,

My index contains a root entity "Post" and a child entity "Comments". Each
post can have multiple comments. data-config.xml:

<document>
            <entity name="posts" transformer="TemplateTransformer"
dataSource="jdbc" query="">

                <field column="post_id" />
                <field column="post_text"/>
                <field column="person_id"/>
                <entity name="comments" dataSource="jdbc" query="select *
from comments where post_id = ${posts.post_id}" >
                    <field column="comment_id" />
                    <field column="comment_text" />
                    <field column="comment_person_id" />
                    <field column="comment_post_id" />
               </entity>
            </entity>
</document>

The schema has all columns of "comment" entity as "MultiValued" fields and
all fields are indexed & stored. My requirement is to count the number of
comments for each post. Approach I'm taking is to query on "*:*" and
faceting the result on "comment_post_id" so that it gives the count of
comment occurred for that post.

But I'm getting incorrect result e.g. if a post has 2 comments, the
multivalued fields are populated alright but the facet count is coming as 1
(for that post_id). What else do I need to do?


Thanks,
Kaushik

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message