Your "correct" doc isn't valid json. Try tag:["tag1", "tag2"] which would be valid.
Upayavira On Sat, Sep 12, 2015, at 08:49 AM, sara hajili wrote: > hi > in my schema i have a tag field. > this field set multiValued="true". > now my question is about search on multivalued field. > if i add thid doc to sor: > { > id:1, > tag:{"tag1","tag2"} > }, > > { > id:2, > tag:{"tag1","tag2"} > }, > > when i search on q="tag1" > i get just : > { > id:1, > tag:{"tag1","tag2"} > }, > > but if i add docs in this way: > { > id:1, > tag:"tag1", > tag:"tag2" > }, > { > id:2, > tag:"tag1", > tag:"tag2" > }, > now if i search to q="tag1" > i get both of docs as a result. > i'm confused.!what is difference between 2 docs? > and can i search on this doc ? > { > id:1, > tag:{"tag1","tag2"} > }, > and get correct result(correct result is getting 2 doc all together) > tnx.