RE: Best and efficient way to find out whether set of records available in Solr

2017-01-31 Thread alessandro.benedetti
If a document is not in Solr, Solr will not return it.

Of course you can play with the API and have your client that will do the
checks and return what you like.
What you will need to do is to fetch the IDs OK from Solr and then you
subtract them from your original list.

Another solution is to add an "available" field, and for the documents not
available you index them as "not available" ( and in case the situation
change you can update them) .
In this case you can simply query and then filter by "available :false" .

Cheers



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Best-and-efficient-way-to-find-out-whether-set-of-records-available-in-Solr-tp4317930p4317996.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: Best and efficient way to find out whether set of records available in Solr

2017-01-30 Thread M, Arjun (Nokia - IN/Bangalore)
Hi Erick,

Let me put it in other way. 

Id : 1,2,3 are present in solr db. 

I query with query param id with values 3,4,5,6, it should return 
4,5,6(records not present in solr)

Thanks & Regards,
   Arjun M

-Original Message-
From: Erick Erickson [mailto:erickerick...@gmail.com] 
Sent: Tuesday, January 31, 2017 11:18 AM
To: solr-user 
Subject: Re: Best and efficient way to find out whether set of records 
available in Solr

bq: if below are the records available in solr, I need to whether id
with values 3,4,5,6 are available in solr or not

This just doesn't make sense to me. _How_ do you decide you want to
know certain docs aren't available? What relation is there between the
presence of docs 1, 2 and 3 and the absence of 3, 4, 5, 6? And you've
said that doc 3 is available, but then asked to be informed that it's
_not_ available.

And what does "unavailable" mean? By what criteria?

Best,
Erick

On Mon, Jan 30, 2017 at 9:39 PM, M, Arjun (Nokia - IN/Bangalore)
 wrote:
> Hi,
>
> I have an use case where I need to find out whether a set of records 
> are available in Solr. Please suggest best and efficient way to achieve it. 
> Any suggestions are appreciated.
>
> For eg : if below are the records available in solr, I need to 
> whether id with values 3,4,5,6 are available in solr or not. I want the query 
> to return list of unavailable records.
>
> [{
>   "id":"1",
> "Name":Arjun
> },
> {
> "id":"2",
> "Name":Arun,
>  },
>  {
>   "id":"3",
> "Name":Arun
>  }]
>
> Thanks & Regards,
>Arjun M
>
>
>


Re: Best and efficient way to find out whether set of records available in Solr

2017-01-30 Thread Erick Erickson
bq: if below are the records available in solr, I need to whether id
with values 3,4,5,6 are available in solr or not

This just doesn't make sense to me. _How_ do you decide you want to
know certain docs aren't available? What relation is there between the
presence of docs 1, 2 and 3 and the absence of 3, 4, 5, 6? And you've
said that doc 3 is available, but then asked to be informed that it's
_not_ available.

And what does "unavailable" mean? By what criteria?

Best,
Erick

On Mon, Jan 30, 2017 at 9:39 PM, M, Arjun (Nokia - IN/Bangalore)
 wrote:
> Hi,
>
> I have an use case where I need to find out whether a set of records 
> are available in Solr. Please suggest best and efficient way to achieve it. 
> Any suggestions are appreciated.
>
> For eg : if below are the records available in solr, I need to 
> whether id with values 3,4,5,6 are available in solr or not. I want the query 
> to return list of unavailable records.
>
> [{
>   "id":"1",
> "Name":Arjun
> },
> {
> "id":"2",
> "Name":Arun,
>  },
>  {
>   "id":"3",
> "Name":Arun
>  }]
>
> Thanks & Regards,
>Arjun M
>
>
>