-Re: Any way to "append" new text to an existing indexed field?
Andy 2010-10-01, 12:23
Well I want to just display the "title" of the question in my search results and users can then just click on it to see the detals of the question and all the answers.
For example, say a question has the title "What is the meaning of life?" and then one of the answers to that question is "solr." If someone searches for "solr", I want to display the question title "What is the meaning of life?" in the search results. If the user clicks on the question title and drills down, he can then see that one of the answers is "solr".
I'm not sure it makes sense to index the question and each answer separately because I don't want to get duplicate questions in the search results. In the above example, let's say there's another answer "solr is the meaning". If each answer is indexed separately, I'd get two "What is the meaning of life?" in my search results when someone searches for "solr".
--- On Fri, 10/1/10, Allistair Crossley <[EMAIL PROTECTED]> wrote:
> From: Allistair Crossley <[EMAIL PROTECTED]>
> Subject: Re: Any way to "append" new text to an existing indexed field?
> To: [EMAIL PROTECTED]
> Date: Friday, October 1, 2010, 7:46 AM
> i would say question and answer are 2
> different entities. if you are using the data import
> handler, i would personally create them as separate entities
> with their own queries to the database using the deltaQuery
> method to pick up only new rows. i guess it depends if you
> need question + answers to actually come back out to be used
> for display (i.e. you stored their data), or whether it's
> good enough to match on question/answer separately and then
> just link to a question ID in your UI to drill-down from the
> disclaimer: i am a solr novice - just started, so i'd see
> what others think too ;)
> On Oct 1, 2010, at 7:38 AM, Andy wrote:
> > I'm building a Q&A application. There's a
> "Question" database table and an "Answer" table.
> > For each question, I'm putting the question itself
> plus all the answers into a single field "text" to be
> indexed and searched.
> > Say I have a question that has 10 existing answers
> that are already indexed. If a new answer is submitted for
> that question, is there any way I could just "append" the
> new answer to the "text" field? Or is the only way to
> implement this is to retrieve the original question and the
> 10 existing answers from the database, combine them with the
> newly submitted 11th answer, and re-index everything from
> > The latter option just seems inefficient. Is there a
> better design that could be used for this use case?
> > Andy