You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Mark Allan <ma...@ed.ac.uk> on 2010/12/16 12:46:30 UTC

Determining core name from a result?

Hi all,

I've been bashing my head against the wall for a few hours now, trying  
to get mlt (more-like-this) queries working across multiple cores.  
I've since seen a JIRA issue and documentation saying that multicore  
doesn't yet support mlt queries.  Oops!

Anyway, to get around this, I was planning to send the mlt query just  
to the specific core that a particular result came from, but I can't  
see a way to obtain that information from the results.  If I figure it  
out by hand, I can get a MLT query to produce similar documents from  
that core which is probably good enough for the time being.

Does anyone know how, after performing a multi-core search to retrieve  
a single document, I can then find out which core that result came from?

I'm using Solr branch_3x.

Many thanks

Mark


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Re: Determining core name from a result?

Posted by Lance Norskog <go...@gmail.com>.
A core is a Solr-controlled Lucene index.

A shard is a core that one part of a distributed search. Shards:
SHOULD have the same schema; you will be so sorry if you don't follow this
MUST have the same unique id field,
MUST be disjoint: no document can be in two different shards

On Thu, Dec 16, 2010 at 8:04 AM, Mark Allan <ma...@ed.ac.uk> wrote:
> Oops! Sorry, I thought shard and core were one in the same and the terms
> could be used interchangeably - I've got a multicore setup which I'm able to
> search across by using the shards parameter.  I think you're right, that
> *is* the question I was asking.
>
> Thanks for letting me know it's not supported yet.  I guess the easiest
> thing for me to do right now is to add another field in each document saying
> which core it was inserted into.
>
> Thanks again
> Mark
>
> On 16 Dec 2010, at 3:46 pm, Chris Hostetter wrote:
>
>> : Subject: Determining core name from a result?
>>
>> FYI: some people may be confused because of terminoligy -- i think what
>> you are asking is how to know which *shard* a document came from when
>> doing a distributed search.
>>
>> This isn't currently supported, there is an open issue tracking it...
>>
>> https://issues.apache.org/jira/browse/SOLR-705
>>
>> -Hoss
>>
>
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>



-- 
Lance Norskog
goksron@gmail.com

Re: Determining core name from a result?

Posted by Mark Allan <ma...@ed.ac.uk>.
Oops! Sorry, I thought shard and core were one in the same and the  
terms could be used interchangeably - I've got a multicore setup which  
I'm able to search across by using the shards parameter.  I think  
you're right, that *is* the question I was asking.

Thanks for letting me know it's not supported yet.  I guess the  
easiest thing for me to do right now is to add another field in each  
document saying which core it was inserted into.

Thanks again
Mark

On 16 Dec 2010, at 3:46 pm, Chris Hostetter wrote:

> : Subject: Determining core name from a result?
>
> FYI: some people may be confused because of terminoligy -- i think  
> what
> you are asking is how to know which *shard* a document came from when
> doing a distributed search.
>
> This isn't currently supported, there is an open issue tracking it...
>
> https://issues.apache.org/jira/browse/SOLR-705
>
> -Hoss
>


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Re: Determining core name from a result?

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: Determining core name from a result?

FYI: some people may be confused because of terminoligy -- i think what 
you are asking is how to know which *shard* a document came from when 
doing a distributed search.

This isn't currently supported, there is an open issue tracking it...

https://issues.apache.org/jira/browse/SOLR-705

-Hoss

Re: Determining core name from a result?

Posted by Mark Allan <ma...@ed.ac.uk>.
Hi Grant,

Thanks for your reply. I'm using solrj to connect via http, which  
eventually sends this query

http://localhost:8984/solr/core0/select/?q=id:022-80633905&version=2&start=0&rows=1&fl=*&indent=on&shards=localhost:8984/solr/core0,localhost:8984/solr/core1,localhost:8984/solr/core2,localhost:8984/solr/core3,localhost:8984/solr/core4

I subsequently send the MLT query which ends up looking like:

http://localhost:8984/solr/core0/mlt/?q=id:022-80633905&version=2&start=0&rows=5&fl=id&indent=on&mlt.fl=description&mlt.match.include=false&mlt.minwl=3&mlt.mintf=1&mlt.mindf=1&localhost:8984/solr/core0,localhost:8984/solr/core1,localhost:8984/solr/core2,localhost:8984/solr/core3,localhost:8984/solr/core4

If I run that query in a browser, the response returned is
<response>
<responseHeader>
<status>0</status>
<QTime>3</QTime>
</responseHeader>
<null name='response'/>
</response>

Now, because I know the the document with id 022-80633905 went into  
core 1, I get the correct results if I change the first part of the  
URL to http://localhost:8984/solr/core1/mlt but doing so requires my  
app (not just me!) to know which core the result came from.

Thanks
Mark

On 16 Dec 2010, at 1:44 pm, Grant Ingersoll wrote:

> How are you querying the core to begin with?
>
> On Dec 16, 2010, at 6:46 AM, Mark Allan wrote:
>
>> Hi all,
>>
>> I've been bashing my head against the wall for a few hours now,  
>> trying to get mlt (more-like-this) queries working across multiple  
>> cores. I've since seen a JIRA issue and documentation saying that  
>> multicore doesn't yet support mlt queries.  Oops!
>>
>> Anyway, to get around this, I was planning to send the mlt query  
>> just to the specific core that a particular result came from, but I  
>> can't see a way to obtain that information from the results.  If I  
>> figure it out by hand, I can get a MLT query to produce similar  
>> documents from that core which is probably good enough for the time  
>> being.
>>
>> Does anyone know how, after performing a multi-core search to  
>> retrieve a single document, I can then find out which core that  
>> result came from?
>>
>> I'm using Solr branch_3x.
>>
>> Many thanks
>>
>> Mark


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Re: Determining core name from a result?

Posted by Grant Ingersoll <gs...@apache.org>.
How are you querying the core to begin with?

On Dec 16, 2010, at 6:46 AM, Mark Allan wrote:

> Hi all,
> 
> I've been bashing my head against the wall for a few hours now, trying to get mlt (more-like-this) queries working across multiple cores. I've since seen a JIRA issue and documentation saying that multicore doesn't yet support mlt queries.  Oops!
> 
> Anyway, to get around this, I was planning to send the mlt query just to the specific core that a particular result came from, but I can't see a way to obtain that information from the results.  If I figure it out by hand, I can get a MLT query to produce similar documents from that core which is probably good enough for the time being.
> 
> Does anyone know how, after performing a multi-core search to retrieve a single document, I can then find out which core that result came from?
> 
> I'm using Solr branch_3x.
> 
> Many thanks
> 
> Mark
> 
> 
> -- 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> 

--------------------------
Grant Ingersoll
http://www.lucidimagination.com/