Hello Donnie,

1. Nothing beside of design consideration prevents you form doing search in
QueryResponseWriter. You have a request, which isn't closed yet, where you
can obtain searcher from.
2. Your usecase isn't clear. If you need just to search categories, and
return the lists of subcategories per every category found, you can just
put your subcats list into huge stored field.
3. Otherwise, it sounds like http://wiki.apache.org/solr/Join or like
https://issues.apache.org/jira/browse/SOLR-3076 , which is in really early
stage, though.

Regards

On Fri, Mar 2, 2012 at 2:40 AM, Donnie McNeal <donnie.mcn...@gmail.com>wrote:

> Hi all,
>
> The documents in our solr index have an parent child relationship which we
> have basically flattened in our solr queries. We have messaged solr into
> being the query API for a 3rd party data.  The relationship is simple
> parent-child relationship as follows:
>
> category
> +-sub-category
>
> this ultimately maps to something like this in our Model:
>
> class Category
>
> List<Category> getChildCategories();
>
> Currently, in our application code we were thinking about issuing 2 queries
> one to get the parent category, and one to get the sub-categories of the
> parent.  We would then assemble the results in our model.
>
> What I was wondering is would it be feasible (or even an ok practice) to
> create a QueryResponseWriter (more than likely subclass an existing one
> like XMLResponseFormat) that when requested it issue an additional call to
> fetch the sub categories and add them to the original category document.
>  Please be gentle with me :).
>
> Maybe we just need to create the index a little bit differently to better
> handle this relationship.
>
> Thanks,
>
> Donnie
>



-- 
Sincerely yours
Mikhail Khludnev
Lucid Certified
Apache Lucene/Solr Developer
Grid Dynamics

<http://www.griddynamics.com>
 <mkhlud...@griddynamics.com>

Reply via email to