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 Raju444us <ng...@cormineid.com> on 2009/04/21 23:40:47 UTC

Solr Getting values for an id

i have a problem.
I have a requirement.I indexed document something like this.The id and
testScore fields are multivalued.
My problem is if i search for id=1 this should return the search results
with id = 1 and testScore = 90.
Is there any way I can do this.

<add>
<doc>
  <field name="myName">Test Name</field>
  <field name="id">1</field>
  <field name="testScore">90</field>
  <field name="id">2</field>
  <field name="testScore">92</field>
  <field name="id">3</field>
  <field name="testScore">97</field>
</doc>
</add>

Thanks,
Naveen


-- 
View this message in context: http://www.nabble.com/Solr-Getting-values-for-an-id-tp23165464p23165464.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Getting values for an id

Posted by Raju444us <ng...@cormineid.com>.
The id field and testScore fields are name value pairs for each id i have a
testScore.When I search based on id  how do I know the position.I there any
method  or api in solr which gives me the position.

I have not understand the second part of your reply.Can you please tell me
how I can do with making those fields non multivalued.If possible some
example or code is help ful

Thanks,
Raju


Otis Gospodnetic wrote:
> 
> 
> You'll have to manually pull/parse those out and match them based on their
> positions, I think.  Or make those fields non-multivalued and add
> additional fields instead, if their number is fixed.
> 
>  Otis
> --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
> 
> 
> 
> ----- Original Message ----
>> From: Raju444us <ng...@cormineid.com>
>> To: solr-user@lucene.apache.org
>> Sent: Tuesday, April 21, 2009 5:40:47 PM
>> Subject: Solr Getting values for an id
>> 
>> 
>> i have a problem.
>> I have a requirement.I indexed document something like this.The id and
>> testScore fields are multivalued.
>> My problem is if i search for id=1 this should return the search results
>> with id = 1 and testScore = 90.
>> Is there any way I can do this.
>> 
>> 
>> 
>>   Test Name
>>   1
>>   90
>>   2
>>   92
>>   3
>>   97
>> 
>> 
>> 
>> Thanks,
>> Naveen
>> 
>> 
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Solr-Getting-values-for-an-id-tp23165464p23165464.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Solr-Getting-values-for-an-id-tp23165464p23165694.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Getting values for an id

Posted by Otis Gospodnetic <ot...@yahoo.com>.
You'll have to manually pull/parse those out and match them based on their positions, I think.  Or make those fields non-multivalued and add additional fields instead, if their number is fixed.

 Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: Raju444us <ng...@cormineid.com>
> To: solr-user@lucene.apache.org
> Sent: Tuesday, April 21, 2009 5:40:47 PM
> Subject: Solr Getting values for an id
> 
> 
> i have a problem.
> I have a requirement.I indexed document something like this.The id and
> testScore fields are multivalued.
> My problem is if i search for id=1 this should return the search results
> with id = 1 and testScore = 90.
> Is there any way I can do this.
> 
> 
> 
>   Test Name
>   1
>   90
>   2
>   92
>   3
>   97
> 
> 
> 
> Thanks,
> Naveen
> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Solr-Getting-values-for-an-id-tp23165464p23165464.html
> Sent from the Solr - User mailing list archive at Nabble.com.