My prev question was

I have updated 2500000 data to solr. 

and some of data have "category" field and some of don't have. 

for example. 

{ 
"id":"321", 
"name":"anurag", 
"category":"30" 
}, 
{ 
"id":"3", 
"name":"john" 
} 

now i want to search that docs who does not have that field. 
what query should like. 
 
I got an answer.

i can use http://localhost:8983/search?q=*:*&fq=-category:[* TO *]


but now i am facing a problem. that i want to search all docs .. who does
not have category field  or category field value = 20

I wrote following query. 

http://localhost:8983/search?q=*:*&wt=json&start=0&fq=category:"20"; OR
-category:[* TO *]

but it is giving me zero output.

http://localhost:8983/search?q=*:*&wt=json&start=0&fq=category:"20";  ->
output = 2689

http://localhost:8983/search?q=*:*&wt=json&start=0&fq=-category:[* TO *]  ->
output = 2644684




what is problem ... am i doing some mistakes ??



--
View this message in context: 
http://lucene.472066.n3.nabble.com/New-Question-On-Search-data-who-does-not-have-x-field-tp4047270.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to