Jack,

Why are multi-valued fields considered messy?
I think I am about to learn something..

Thanks
Another Jack

On Mon, May 13, 2013 at 5:29 AM, Jack Krupansky <j...@basetechnology.com> wrote:
> Try the simplest, cleanest design first (at least on paper), before you
> start resorting to either dynamic fields or multi-valued fields or other
> messy approaches. Like, one collection for stories, which would have a story
> id and a second collection for comments, each with a comment id and a field
> that is the associated story id and user id. And a third collection for
> users and their profiles. Identify the user and get their user id. Identify
> the story (maybe by keyword search) to get story id. Then identify and facet
> user comments by story id and user id and whatever other search criteria,
> and then facet on that.
>
> -- Jack Krupansky
>
> -----Original Message----- From: samabhiK
> Sent: Monday, May 13, 2013 5:24 AM
> To: solr-user@lucene.apache.org
> Subject: Best way to design a "story and comments" schema.
>
>
> Hi, I wish to know how to best design a schema to store comments in stories
> /
> articles posted.
> I have a set of fields:
>   /   &lt;field name=&quot;subject&quot; type=&quot;text_general&quot;
> indexed=&quot;true&quot; stored=&quot;true&quot;/&gt;
>   &lt;field name=&quot;keywords&quot; type=&quot;text_general&quot;
> indexed=&quot;true&quot; stored=&quot;true&quot;/&gt;
>   &lt;field name=&quot;category&quot; type=&quot;text_general&quot;
> indexed=&quot;true&quot; stored=&quot;true&quot;/&gt;
>   &lt;field name=&quot;content&quot; type=&quot;text_general&quot;
> indexed=&quot;false&quot; stored=&quot;true&quot; /&gt;   /
> Users can post their comments on a post and I should be able to retrieve
> these comments and show it along side the original post. I only need to show
> the last 3 comments and show a facet of the remaining comments which user
> can click and see the rest of the comments ( something like facebook does ).
> One alternative, I could think of, was adding a dynamic field for all
> comments :
> /&lt;dynamicField name=&quot;comment_*&quot;  type=&quot;string&quot;
> indexed=&quot;false&quot;  stored=&quot;true&quot;/&gt;/
> So, to store each comments, I would send a text to solr of the form ->
> For Field Name: /comment_n/ Value:/[Commenter Name]:[Commenter ID]:[Actual
> Comment Text]/
> And to keep the count of those comments, I could use another field like so
> :/&lt;field name=&quot;comment_count&quot; type=&quot;int&quot;
> indexed=&quot;true&quot; stored=&quot;true&quot;/&gt;/
> With this approach, I will have to do some calculation when a comment is
> deleted by the user but I still can manage to show the comments right.
> My idea is to find the best solution for this scenario which will be fast
> and also be simple.
> Kindly suggest.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Best-way-to-design-a-story-and-comments-schema-tp4062867.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to