Why not just flatten this? I.e. have fields
prev_temp
day_temp
next_temp
prev_humidity
day_humitidy
next_humidity
?

If you use multiValued fields, there's no good way to
express
prev_temp=X AND prev_humidity=Y
because they'd both be in a single MV field called "temp"
and "humidity"
so querying
temp=X and humidity=Y could match
the previous day's temp and the next day's humidity.

Best,
Erick

On Wed, Jun 8, 2016 at 1:52 PM, Aniruddh Sharma <asharma...@gmail.com> wrote:
> Hi Susheel
>
> Thanks for prompt response.
>
> I have a further query on it.  Wouldn't above mentioned approach be
> appropriate if I am either getting PreviousDay or CurrentDay.
>
> In my case I will sometimes be getting both PreviousDay and CurrentDay in
> same record. so when I store temp/humidity as multi-valued it wouldn't know
> whether I have stored for previousDay or currentDay.
>
> Kindly guide me if I misunderstand.
>
> Thanks and Regards
> Aniruddh
>
> On Wed, Jun 8, 2016 at 4:41 PM, Susheel Kumar <susheel2...@gmail.com> wrote:
>
>> How about creating schema with temperature, humidity & a day field (and
>> other fields you may have like zipcode/city/country etc). Put day="next" or
>> day="previous" and during query use fq (filter query) to have
>> fq=day:previous or fq=day:next.
>>
>> Thanks,
>> Susheel
>>
>> On Wed, Jun 8, 2016 at 2:46 PM, Aniruddh Sharma <asharma...@gmail.com>
>> wrote:
>>
>> > Hi
>> >
>> > Request help
>> >
>> > I have following XML data to start with
>> >
>> > <Weather>
>> >    <previousDay>
>> >       <temperature>13</temp>
>> >       <humidity>50</humidity>
>> >     </previousDay>
>> >    <nextDay>
>> >       <temperature>15</temp>
>> >       <humidity>60</humidity>
>> >     </nextDay>
>> > </Weather>
>> >
>> >
>> > Please notice it has "previousDay" and "nextDay" and both of them
>> contains
>> > details of same field "temperature" and "humidity"
>> >
>> > What is best way to create schema for it , where I could query for
>> > temperature on previousDay as well as on currentDay
>> >
>> >
>> >
>> > Thanks and Regards
>> > Aniruddh
>> >
>>

Reply via email to