You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Cao Manh Dat (JIRA)" <ji...@apache.org> on 2015/12/15 11:33:46 UTC
[jira] [Comment Edited] (SOLR-8208) DocTransformer executes
sub-queries
[ https://issues.apache.org/jira/browse/SOLR-8208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15057812#comment-15057812 ]
Cao Manh Dat edited comment on SOLR-8208 at 12/15/15 10:33 AM:
---------------------------------------------------------------
Initial patch,
I change the API a little bit to make it easier to parse.
{code}
[subquery f=fromField t=toField v=value start=0 rows=10]
{code}
The result so far.
Input
{code}
doc("id", "4","name_s", "dave", "title_s", "MTS", "dept_ss_dv","Support", "dept_ss_dv","Engineering"))
doc("id","10", "dept_id_s", "Engineering", "text_t","These guys develop stuff", "salary_i_dv", "1000")
doc("id","13", "dept_id_s", "Support", "text_t","These guys help customers","salary_i_dv", "800")
{code}
Output
{code}
{
"id": "4",
"name_s_dv": "dave",
"title_s_dv": "MTS",
"dept_ss_dv": [
"Support",
"Engineering"
],
"depts": [
{
"id": "10",
"dept_id_s_dv": "Engineering",
"text_t": "These guys develop stuff",
"salary_i_dv": 1000
},
{
"id": "13",
"dept_id_s_dv": "Support",
"text_t": "These guys help customers",
"salary_i_dv": 800
}
]
}
{code}
Managing to work on sort and fl params. Am i on right track?
was (Author: caomanhdat):
Initial patch,
I change the API a little bit to make it easier to parse.
{code}
[subquery f=fromField t=toField v=value start=0 rows=10]
{code}
Managing to work on sort and fl params. Am i on right track?
> DocTransformer executes sub-queries
> -----------------------------------
>
> Key: SOLR-8208
> URL: https://issues.apache.org/jira/browse/SOLR-8208
> Project: Solr
> Issue Type: Improvement
> Reporter: Mikhail Khludnev
> Labels: features, newbie
> Attachments: SOLR-8208.patch
>
>
> The initial idea was to return "from" side of query time join via doctransformer. I suppose it isn't query-time join specific, thus let to specify any query and parameters for them, let's call them sub-query. But it might be problematic to escape subquery parameters, including local ones, e.g. what if subquery needs to specify own doctransformer in &fl=\[..\] ?
> I suppose we can allow to specify subquery parameter prefix:
> {code}
> ..&fl=id,[subquery paramPrefix=subq1. fromIndex=othercore],score,..&subq1.q={!term f=child_id v=$subq1.row.id}&subq1.rows=3&subq1.sort=price&..
> {code}
> * {{paramPrefix=subq1.}} shifts parameters for subquery: {{subq1.q}} turns to {{q}} for subquery, {{subq1.rows}} to {{rows}}
> * {{fromIndex=othercore}} optional param allows to run subquery on other core, like it works on query time join
> * the itchiest one is to reference to document field from subquery parameters, here I propose to use local param {{v}} and param deference {{v=$param}} thus every document field implicitly introduces parameter for subquery $\{paramPrefix\}row.$\{fieldName\}, thus above subquery is q=child_id:<doc.getField("id")>, presumably we can drop "row." in the middle (reducing to v=$subq1.id), until someone deal with {{rows}}, {{sort}} fields.
> * \[subquery\], or \[query\], or ?
> Caveat: it should be a way slow; it handles only search result page, not entire result set.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org