Seeing if an entry exists in an index for a set of terms

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Seeing if an entry exists in an index for a set of terms

Ian Holsman (Lists)
Hi.

I was wondering if there was a easy way to give solr a list of things
and finding out which have entries.


ie I pass it a list

Bill Clinton
George Bush
Mary Papas
(and possibly 20 others)

to a solr index which contains news articles about presidents. I would
like a response saying

bill Clinton was found in 20 records
George Bush was found in 15.

possibly with the links, but thats not too important.

I know I can do this by doing ~20 individual queries, but I thought
there may be a more efficient way

Regards
Ian
Reply | Threaded
Open this post in threaded view
|

Re: Seeing if an entry exists in an index for a set of terms

Yonik Seeley-2
On 10/3/07, Ian Holsman <[hidden email]> wrote:

> Hi.
>
> I was wondering if there was a easy way to give solr a list of things
> and finding out which have entries.
>
>
> ie I pass it a list
>
> Bill Clinton
> George Bush
> Mary Papas
> (and possibly 20 others)
>
> to a solr index which contains news articles about presidents. I would
> like a response saying
>
> bill Clinton was found in 20 records
> George Bush was found in 15.
>
> possibly with the links, but thats not too important.
>
> I know I can do this by doing ~20 individual queries, but I thought
> there may be a more efficient way

How about
facet.query=Bill Clinton&facet.query=George Bush, etc

Will give you counts, but not the links

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: Seeing if an entry exists in an index for a set of terms

Ian Holsman (Lists)
Yonik Seeley wrote:

> On 10/3/07, Ian Holsman <[hidden email]> wrote:
>  
>> Hi.
>>
>> I was wondering if there was a easy way to give solr a list of things
>> and finding out which have entries.
>>
>>
>> ie I pass it a list
>>
>> Bill Clinton
>> George Bush
>> Mary Papas
>> (and possibly 20 others)
>>
>> to a solr index which contains news articles about presidents. I would
>> like a response saying
>>
>> bill Clinton was found in 20 records
>> George Bush was found in 15.
>>
>> possibly with the links, but thats not too important.
>>
>> I know I can do this by doing ~20 individual queries, but I thought
>> there may be a more efficient way
>>    
>
> How about
> facet.query=Bill Clinton&facet.query=George Bush, etc
>
> Will give you counts, but not the links
>
> -Yonik
>
>  
That will work.
Thanks Yonik.