One thing I've seen suggested is to add the number of values to
a separate field, say topic_count. Then, in your situation above
you could append "AND topic_count=1". This can extend
to work if you wanted any number of matches (and only
that number). For instance,
topic=5 AND topic=10 AND topic=20 AND topic_count=3 would
give you article 4.....

Don't know if this works in your particular situation....

Erick

On Mon, Mar 22, 2010 at 10:32 AM, Armando Ota <armando...@siol.net> wrote:

> Hi
>
> I need a little help with query for my problem (if it can be solved)
>
> I have a field in a document called topic
>
> this field contains some values, 0 (for no topic) or  1 (topic 1), 2, 3,
> etc ...
>
> It can contain many values like 1, 10, 50, etc (for 1 doc)
>
> So now to the problem:
> I would like to get documents that have 0 for topic value and documents
> that only have for example 1 for topic value inserted
>
> articles for example:
> article 1topics: 1, 5, 10, 20, 24
> article 2 topics: 0
> article 3 topics: 1
> article 4 topic: 5, 10, 20
> article 5 topic: 1, 13, 19
>
> So I need search query to return me only article 2 and 3 not other articles
> with 1 for topic value
>
> Can that be done ? Any help appreciated
>
> Kind regards
>
> Armando
>
>

Reply via email to