On Mon, Dec 30, 2013 at 5:38 AM, Tim Williams <[email protected]> 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
>

Yeah if you don't want to index twice Tim's approach is probably the best
way to go.

Even shorter it could be Tag:(+Tag1 -TagA -TagB)

Aaron


>
> 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
>

Reply via email to