lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Gazzarini <a.gazzar...@sease.io>
Subject Re: Explode kind of function in Solr
Date Thu, 13 Sep 2018 10:29:57 GMT
Hi,
as far as I know, this is not possible. Solr is document-oriented, 
meaning with that its datamodel works using a "document" level of 
granularity. If you index A, you get A.
I see a couple of chances (maybe someone else could add other options):

  * index exactly what you need: in your case I would index *3 docs*
    with a grouping criteria *"1"* (it is your current id, which cannot
    be an id in this case)
  * index 1 document with multivalued "phone" id (like in your example),
    and have an intermediate API layer or directly the frontend which
    "expands" the result as you want.

Best,
Andrea

On 13/09/18 12:20, Rushikesh Garadade wrote:
> Hello All,
> Is there any functionality in solr that can convert (explode) results from
> 1 document to many docuement.
> *Example: *
> Lets say I have doc:
> {
> id:1,
> phone: [111111,222222,333333]
> }
>
> when I query to solr with id=1 I want result as below:
> [{
> id:1,
> phone:111111
> },
> {
> id:1,
> phone:222222
> },
> {
> d:1,
> phone:333333
> }]
>
> Please let me know if this is possible in Solr , if Yes how?
>
> Thanks,
> Rushikesh Garadade
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message