incubator-blur-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Naresh Yadav <nyadav....@gmail.com>
Subject Re: Blue query for exact match
Date Tue, 31 Dec 2013 05:24:27 GMT
Hi tim,

list of tags is not small, can be really big so i cannot use negate the
tags approach...Other approach you said is using subfields how to do that
in blur...My thought on this was to introduce new column Tags which will
store sorted all tags of that row...So for cases where i need exact match
then will query on *Tags* column and case where i need partial match of
tags then will use Tag column..
Changed data is :

Row1 : Measure=Cost, Period=Nov13, Tag=Tag1, Tag=TagA, *Tags*=Tag1,TagA
Value=50
Row2 : Measure=Cost, Period=Nov13, Tag=Tag1, Tag=TagB , *Tags*=Tag1,TagB
Value=20
Row3 : Measure=Cost, Period=Nov13, Tag=Tag1, *Tags*=Tag1 Value=210
Row4 : Measure=Cost, Period=Nov13, Tag=Tag2, Tag=TagA *Tags*=Tag2,TagA
Value=120

A) Give me all rows which has tag as Tag1
Query : Tag:Tag1

B) Give me all rows which has only tag as Tag1, no other tag
Query : *Tags*:Tag1

I hope i am not unncessary complicating this and hitting performance..Give
your opinion..

Thanks
Naresh

On Mon, Dec 30, 2013 at 4:08 PM, Tim Williams <williamstw@gmail.com> wrote:

> On Monday, December 30, 2013, Naresh Yadav wrote:
>
> > Hi,
> >
> > I had designed my table like this :
> >
> > Row1 : Measure=Cost, Period=Nov13, Tag=Tag1, Tag=TagA,  Value=50
> > Row2 : Measure=Cost, Period=Nov13, Tag=Tag1, Tag=TagB , Value=20
> > Row3 : Measure=Cost, Period=Nov13, Tag=Tag1, Value=210
> > Row4 : Measure=Cost, Period=Nov13, Tag=Tag2, Tag=TagA Value=120
> >
> > I need to two types of queries :
> >
> > A) Give me all rows which has tag as Tag1
> > Query : Tag:Tag1
> > Expected Result : Row1, Row2, Row3
> >
> > B) Give me all rows which has only tag as Tag1, no other tag
> > Query : ?
> > Expected Result : Row3
> >
> > Please help me in writing BLUR query for problem B)
> >
>
> If the list is a smallish set, you could just negate the tags you don't
> want:
> Tag:Tag1 -Tag:TagA -Tag:TagB
>
> Otherwise, I reckon you could index them twice, once as text and again as
> strings - maybe using sub fields - and query the different fields depending
> in the desired behavior?
>
> --tim
>

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