[ 
https://issues.apache.org/jira/browse/SOLR-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15027313#comment-15027313
 ] 

Yonik Seeley commented on SOLR-7672:
------------------------------------

Hmmm, \_parent\_:true wouldn't seem to work that well for multi-level 
hierarchies (remember, we're not limited to a single parent-child level).

Seems like something more general is desirable.  It feels like indexing 
\_path\_ would be both general and very useful.  The top-level parents would 
have a zero length _path_:""   Unfortunately, "/" is used by regex in the 
lucene query parser, so we could use "." as a path separator instead.

This fits in well with (future) auto-mapping from JSON structure to nested 
documents.

Example:
{code}
{
  id:x,
  work_address: {
    state:NY,
    street:"my work street"
  },
  home_address:{
    state:NJ,
    street:"my_home street"
  },
  cars:[
    {
      make: Toyota,
      model: Highlander
    },
    {
      make: Honda,
      model: Accord
    }
  ]  
}
{code}

_path_ would be "" for the root, then "home_address", "street_address", and 
"cars" for the other nested documents.

Note: I'm not asking that all this be *done* in this issue, just that we think 
about the end-game for nested documents (where we want to go), and make 
whatever we do fit in with that scheme.  For this specific JIRA issue, all that 
would need to be done is use a more generic \_path\_:"" 

Hmmm, perhaps \_type\_ would be a better name, since we aren't including id 
values or anything, we're just deriving a type name from the path.


> introduce implicit _parent_:true  
> ----------------------------------
>
>                 Key: SOLR-7672
>                 URL: https://issues.apache.org/jira/browse/SOLR-7672
>             Project: Solr
>          Issue Type: Improvement
>          Components: query parsers, update
>    Affects Versions: 5.2
>            Reporter: Mikhail Khludnev
>            Assignee: Mikhail Khludnev
>             Fix For: 5.4, Trunk
>
>
> Solr provides block join support in non-invasive manner. It turns out, it 
> gives a chance to shoot a leg. As it was advised by [~thetaphi] at SOLR-7606, 
> let AddUpdateCommand add _parent_:true field to the document (not to 
> children). Do it *always* no matter whether it has children or not.    
> Also, introduce default values for for block join qparsers \{!parent 
> *which=\_parent\_:true*} \{!child *of=\_parent\_:true*} (sometimes, I rather 
> want to hide them from the user, because they are misunderstood quite often). 
>  
> Please share your concerns and vote.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to