Anand,

have a look at the example schema, there is a section that explains
"invariants" which could be one solution to your question.

-Stefan

On Wed, Apr 6, 2016 at 12:01 PM, Anand Chandrashekar
<anandchan...@gmail.com> wrote:
> Greetings.
>
> 1) A join query creates an array of "q" parameter. For example, the query
>
> http://localhost:8983/solr/gettingstarted/select?q=projectdata%3A%22top+secret+data2%22&q=%7B!join+from=locatorByUser+to=locator%7Dusers=joe
>
> creates the following array elements for the "q" parameter.
>
> [array entry #1] projectdata:"top secret data2"
> [array entry #2] {!join from=locatorByUser to=locator}users=joe
>
> 2) I would like to enforce the join part as a mandatory parameter with the
> "users" field added programmatically. I have extended the search handler,
> and am mimicking the array entry # 2 and adding it to the SolrParams.
>
> Pseudocode handleRequestBody:
> ModifiableSolrParams modParams=new
> ModifiableSolrParams(request.getParams());
> modParams.set("q",...);//adding the join (array entry # 2) part and the
> original query
> request.setParams(modParams);
> super.handleRequestBody(request, response);
>
> I am able to mimic the exact array, but the query does not enforce the
> join. Seems to only pick the first entry. Any advice/suggestions?
>
> Thanks and regards.
> Anand.

Reply via email to