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 "kiran.bodigam" <ki...@gmail.com> on 2011/10/18 13:14:35 UTC

How to retreive multiple documents using one unique field?

I have four different documents in single xml file(to be indexed), i don't
want inject the unique field  for each and every document .when i search
with with the unique field all the four documents should come in result.i.e
can common unique field should be applied to the all documents?
My xml format :
<add>
<doc><field></field></doc>
<doc><field></field></doc>
<doc><field></field></doc>
<doc><field></field></doc>
<commonunique><id>123</id></commonunique>
</add>
If i search for 123 all the four documents should come Is it possible ?

--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-retreive-multiple-documents-using-one-unique-field-tp3430931p3430931.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to retreive multiple documents using one unique field?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
This won't work.  But you could add all 4 docs with the same "123" value in their id fields, just comment out uniqueKey field.  Don't ask me what will or will not happen when you later try updating a document with id:123...

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


>________________________________
>From: kiran.bodigam <ki...@gmail.com>
>To: solr-user@lucene.apache.org
>Sent: Tuesday, October 18, 2011 7:14 AM
>Subject: How to retreive multiple documents using one unique field?
>
>I have four different documents in single xml file(to be indexed), i don't
>want inject the unique field  for each and every document .when i search
>with with the unique field all the four documents should come in result.i.e
>can common unique field should be applied to the all documents?
>My xml format :
><add>
><doc><field></field></doc>
><doc><field></field></doc>
><doc><field></field></doc>
><doc><field></field></doc>
><commonunique><id>123</id></commonunique>
></add>
>If i search for 123 all the four documents should come Is it possible ?
>
>--
>View this message in context: http://lucene.472066.n3.nabble.com/How-to-retreive-multiple-documents-using-one-unique-field-tp3430931p3430931.html
>Sent from the Solr - User mailing list archive at Nabble.com.
>
>
>

RE: How to retreive multiple documents using one unique field?

Posted by "Jaeger, Jay - DOT" <Ja...@dot.wi.gov>.
I do not believe that it will work as you have written it, unless you put an application in between to read that XML and then call Solr with what it expects.  See http://wiki.apache.org/solr/UpdateXmlMessages

You need to have:

<add>
<doc>
	<field name="id">unique-value-if-any-1</field>
	<field name="field1">abc</field>
	<field name="commonunique">123</field>
</doc>
<doc>
	<field name="id">unique-value-if-any-2</field>
	<field name="field1">def</field>
	<field name="commonunique">123</field>
</doc>
<doc>
	<field name="id">unique-value-if-any-3</field>
	<field name="field1">ghi</field>
	<field name="commonunique">123</field>
</doc>
</add>


-----Original Message-----
From: kiran.bodigam [mailto:kiran.bodigam@gmail.com] 
Sent: Tuesday, October 18, 2011 6:15 AM
To: solr-user@lucene.apache.org
Subject: How to retreive multiple documents using one unique field?

I have four different documents in single xml file(to be indexed), i don't
want inject the unique field  for each and every document .when i search
with with the unique field all the four documents should come in result.i.e
can common unique field should be applied to the all documents?
My xml format :
<add>
<doc><field></field></doc>
<doc><field></field></doc>
<doc><field></field></doc>
<doc><field></field></doc>
<commonunique><id>123</id></commonunique>
</add>
If i search for 123 all the four documents should come Is it possible ?

--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-retreive-multiple-documents-using-one-unique-field-tp3430931p3430931.html
Sent from the Solr - User mailing list archive at Nabble.com.