These are the documents I have inserted in the database.
<biblio>
<biblioid>123</biblioid>
<mediaid>456</mediaid>
<name>dixit</name>
<title>title</title>
</biblio>
<biblio>
<biblioid>456</biblioid>
<mediaid>789</mediaid>
<name>singla</name>
<title>title1</title>
</biblio>
<media>
<mediaid>456</mediaid>
<mediaName>media1</mediaName>
<title>hello</title>
</media>
<media>
<mediaid>789</mediaid>
<mediaName>media1</mediaName>
<title>hello</title>
</media>
<media>
<mediaid>384</mediaid>
<mediaName>media2</mediaName>
<title>hello</title>
</media>
I want to search those documents having <name>
in <biblio>
as "Dixit" and <medianame>
in <media>
as "media1".
But it should check of only those documents having <mediaid>
is same as in biblio/mediaid
As in our case, the result will be
<biblio>
<biblioid>123</biblioid>
<mediaid>456</mediaid>
<name>dixit</name> <!-- name is matching ("dixit")-->
<title>title</title>
</biblio>
<media>
<mediaid>456</mediaid> <!-- mediaid is same as in biblio/mediaid -->
<mediaName>media1</mediaName> <!-- medianame is matching ("media1") -->
<title>hello</title>
</media>
I can achieve this, first by getting all the biblio docs matching the name ("dixit") then from the results I will extract the mediaid's(456) and then will query the media documents with fetched mediaid's(456) and medianame(media1).
But I want to achieve this by search:search API.
Is there any way to make this happen and Is there any place where I can define the relationship between elements of xmls.