lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From EquilibriumCST <valeri_ho...@abv.bg>
Subject Nested query in SOLR filter query (fq)
Date Mon, 15 Jul 2013 11:19:12 GMT
Hi all,

I have the following case.

Solr documents has fields --> id and status. Id is not unique. Unique is the
combination of these two elements.
Documents with same id have different statuses.

List of Documents
 
 -ID-  -STATUS-
  id1        1
  id1        2
  id1        3
  id1        4
  id2        1
  id2        2
  id3        1
  
I need to make query that takes all documents with specific status and to
exclude documents that don't have other specific status. 
As an example I need to get all documents with status 2 and don't have
status 3. 
The expected result should be document :
     id2    2
 
Another example: all documents with status 1 and don't have status 3. Then
the result should be: 
     id2        1
     id3        1
  
Here is my query that don't work
http://192.168.130.14:13080/solr/select/?q=status:1&version=2.2&start=0&rows=10&indent=on&fl=id,status&fq=-id:(*:*%20AND%20status:2)
The problem is in filter query(fq) part. In fq must be the ids of the
documents with status 2 and if the current document id is in this list to be
excluded.
I guess some subquery must be used in fq part or something else. 
Just for information we are using APACHE SOLR 3.6 and document count is
around 100k.

Thanks in advance!



--
View this message in context: http://lucene.472066.n3.nabble.com/Nested-query-in-SOLR-filter-query-fq-tp4078020.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message