You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Anshuman Mishra <An...@indiatimes.co.in> on 2010/04/22 12:44:00 UTC
Nested entity returns just one resultset, how to configure!!!
Hi Folks
I have a few tables like tbl_keywords(idTbl_keywords,idTbl_Parent_Content_Container, keyword_value), tbl_parent_content_container(idTbl_Parent_Content_Container,content_title) and tbl_content(idtbl_content, IdParent_Content_Container, content_synopsis ).
On the basis of search string, I perform a search on keyword_value and try to get corresponding values from other two tables i.e. content_title and content_synopsis.
However tbl_keywords has 'one to many' relationship with tbl_content. My data-config.xml looks something like below:
.....
<entity name="tbl_keywords"
query="select idTbl_keywords,idMaster_DCMES_Elements,DCMES_Element_Parent_Name,Keyword_Value,idTbl_Parent_Content_Container,Tbl_Parent_Content_Container_Content_Title from tbl_keywords">
<field column="idTbl_keywords" name="id" />
<field column="idMaster_DCMES_Elements" name="idMaster_DCMES_Elements" />
<field column="DCMES_Element_Parent_Name" name="DCMES_Element_Parent_Name" />
<field column="Keyword_Value" name="Keyword_Value" />
<field column="idTbl_Parent_Content_Container" name="idTbl_Parent_Content_Container" />
<field column="Tbl_Parent_Content_Container_Content_Title" name="Tbl_Parent_Content_Container_Content_Title" />
<entity name="tbl_parent_content_container"
query ="select idTbl_Parent_Content_Container,Content_Title from tbl_parent_content_container WHERE idTbl_Parent_Content_Container IN (${tbl_keywords.idTbl_Parent_Content_Container})">
<field column="idTbl_Parent_Content_Container" name="idTbl_Parent_Content_Container" />
<field column="Content_Title" name="Content_Title" />
</entity>
<entity name="tbl_contents"
query ="select idTbl_Content,Content_synopsis from tbl_contents WHERE IdParent_Content_Container=${tbl_keywords.idTbl_Parent_Content_Container}">
<field column="idTbl_Content" name="idTbl_Content" />
<field column="Content_synopsis" name="Content_synopsis"/>
</entity>
</entity>
...
However when I perform a search on any of the string through admin screen I just get first matching record from tbl_content and nothing else. I want all the matching records to be displayed. Any help would be greatly appreciated.
Regards,
Anshuman
Get every market update!
Log on to m.economictimes.com from your mobile.
DISCLAIMER AND PRIVILEGE NOTICE: This e-mail message contains
confidential, copyright, proprietary and legally privileged
information.It should not be used by anyone who is not the
original intended recipient. If you have erroneously received
this message, please delete it immediately and notify the sender.
The recipient must note and understand that any views expressed
in this message are those of the individual sender and no binding
nature of the message shall be implied or assumed unless the sender
does so expressly with due authority of BCCL subsidiaries and
associated companies, Collectively Times Group.
Re: Nested entity returns just one resultset, how to configure!!!
Posted by Erick Erickson <er...@gmail.com>.
>From Hossmans apache page:
Please Use "java-user@lucene" Not "java-dev@lucene"
Your question is better suited for the java-user@lucene mailing list ...
not the java-dev@lucene list. java-dev is for discussing development of
the internals of the Lucene Java library ... it is *not* the appropriate
place to ask questions about how to use the Lucene Java library when
developing your own applications. Please resend your message to
the java-user mailing list, where you are likely to get more/better
responses since that list also has a larger number of subscribers.
On Thu, Apr 22, 2010 at 6:44 AM, Anshuman Mishra <
Anshuman.Mishra@indiatimes.co.in> wrote:
>
>
> Hi Folks
>
>
>
> I have a few tables like *tbl_keywords*(idTbl_keywords,idTbl_Parent_Content_Container,
> keyword_value), *tbl_parent_content_container*(idTbl_Parent_Content_Container,content_title)
> and *tbl_content*(idtbl_content, IdParent_Content_Container,
> content_synopsis ).
>
>
>
> On the basis of search string, I perform a search on* keyword_value* and
> try to get corresponding values from other two tables i.e. content_title and
> content_synopsis.
>
> However *tbl_keywords *has ‘one to many’ relationship with* tbl_content. *My
> data-config.xml looks something like below:
>
>
>
> …..
>
> <entity name="tbl_keywords"
>
> query="select
> idTbl_keywords,idMaster_DCMES_Elements,DCMES_Element_Parent_Name,Keyword_Value,idTbl_Parent_Content_Container,Tbl_Parent_Content_Container_Content_Title
> from tbl_keywords">
>
> <field column="idTbl_keywords" name="id" />
>
> <field column="idMaster_DCMES_Elements"
> name="idMaster_DCMES_Elements" />
>
> <field column="DCMES_Element_Parent_Name"
> name="DCMES_Element_Parent_Name" />
>
> <field column="Keyword_Value" name="Keyword_Value" />
>
> <field column="idTbl_Parent_Content_Container"
> name="idTbl_Parent_Content_Container" />
>
> <field column="Tbl_Parent_Content_Container_Content_Title"
> name="Tbl_Parent_Content_Container_Content_Title" />
>
> <entity name="tbl_parent_content_container"
>
> query ="select idTbl_Parent_Content_Container,Content_Title from
> tbl_parent_content_container WHERE idTbl_Parent_Content_Container IN
> (${tbl_keywords.idTbl_Parent_Content_Container})">
>
> <field
> column="idTbl_Parent_Content_Container"
> name="idTbl_Parent_Content_Container" />
>
> <field column="Content_Title"
> name="Content_Title" />
>
> </entity>
>
> <entity name="tbl_contents"
>
> query ="select idTbl_Content,Content_synopsis from tbl_contents WHERE
> IdParent_Content_Container=${tbl_keywords.idTbl_Parent_Content_Container}">
>
> <field column="idTbl_Content"
> name="idTbl_Content" />
>
> <field column="Content_synopsis"
> name="Content_synopsis"/>
>
> </entity>
>
> </entity>
>
>
>
> …
>
>
>
>
>
> However when I perform a search on any of the string through admin screen I
> just get first matching record from tbl_content and nothing else. I want all
> the matching records to be displayed. Any help would be greatly appreciated.
>
>
>
> Regards,
>
> Anshuman
>
> Get every market update!
> Log on to m.economictimes.com from your mobile.
>
> DISCLAIMER AND PRIVILEGE NOTICE: This e-mail message contains
> confidential, copyright, proprietary and legally privileged
> information.It should not be used by anyone who is not the
> original intended recipient. If you have erroneously received
> this message, please delete it immediately and notify the sender.
> The recipient must note and understand that any views expressed
> in this message are those of the individual sender and no binding
> nature of the message shall be implied or assumed unless the sender
> does so expressly with due authority of BCCL subsidiaries and
> associated companies, Collectively Times Group.
>
>
Re: Nested entity returns just one resultset, how to configure!!!
Posted by Pradeep Pujari <Pr...@rocketmail.com>.
did you add multivalued=true in schema.xml ?
Pradeep
--- On Thu, 4/22/10, Anshuman Mishra <An...@indiatimes.co.in> wrote:
From: Anshuman Mishra <An...@indiatimes.co.in>
Subject: Nested entity returns just one resultset, how to configure!!!
To: "dev@lucene.apache.org" <de...@lucene.apache.org>
Date: Thursday, April 22, 2010, 3:44 AM
Hi Folks
I have a few tables like tbl_keywords(idTbl_keywords,idTbl_Parent_Content_Container, keyword_value), tbl_parent_content_container(idTbl_Parent_Content_Container,content_title) and tbl_content(idtbl_content, IdParent_Content_Container, content_synopsis ).
On the basis of search string, I perform a search on keyword_value and try to get corresponding values from other two tables i.e. content_title and content_synopsis.
However tbl_keywords has ‘one to many’ relationship with tbl_content. My data-config.xml looks something like below:
…..
<entity name="tbl_keywords"
query="select idTbl_keywords,idMaster_DCMES_Elements,DCMES_Element_Parent_Name,Keyword_Value,idTbl_Parent_Content_Container,Tbl_Parent_Content_Container_Content_Title from tbl_keywords">
<field column="idTbl_keywords" name="id" />
<field column="idMaster_DCMES_Elements" name="idMaster_DCMES_Elements" />
<field column="DCMES_Element_Parent_Name" name="DCMES_Element_Parent_Name" />
<field column="Keyword_Value" name="Keyword_Value" />
<field column="idTbl_Parent_Content_Container" name="idTbl_Parent_Content_Container" />
<field column="Tbl_Parent_Content_Container_Content_Title" name="Tbl_Parent_Content_Container_Content_Title" />
<entity name="tbl_parent_content_container"
query ="select idTbl_Parent_Content_Container,Content_Title from tbl_parent_content_container WHERE idTbl_Parent_Content_Container IN (${tbl_keywords.idTbl_Parent_Content_Container})">
<field column="idTbl_Parent_Content_Container" name="idTbl_Parent_Content_Container" />
<field column="Content_Title" name="Content_Title" />
</entity>
<entity name="tbl_contents"
query ="select idTbl_Content,Content_synopsis from tbl_contents WHERE IdParent_Content_Container=${tbl_keywords.idTbl_Parent_Content_Container}">
<field column="idTbl_Content" name="idTbl_Content" />
<field column="Content_synopsis" name="Content_synopsis"/>
</entity>
</entity>
…
However when I perform a search on any of the string through admin screen I just get first matching record from tbl_content and nothing else. I want all the matching records to be displayed. Any help would be greatly appreciated.
Regards,
AnshumanGet every market update!
Log on to m.economictimes.com from your mobile.
DISCLAIMER AND PRIVILEGE NOTICE: This e-mail message contains
confidential, copyright, proprietary and legally privileged
information.It should not be used by anyone who is not the
original intended recipient. If you have erroneously received
this message, please delete it immediately and notify the sender.
The recipient must note and understand that any views expressed
in this message are those of the individual sender and no binding
nature of the message shall be implied or assumed unless the sender
does so expressly with due authority of BCCL subsidiaries and
associated companies, Collectively Times Group.