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 regany <re...@newzealand.co.nz> on 2009/12/08 23:08:59 UTC

do copyField's need to exist as Fields?

Hello!

(solr newbie alert)

I want to pass 4 fields into Solr

1. id (unique)
2. title
3. subtitle
4. body

but only want to index and store 2:

1. id (unique)
2. text (copyField of id, title, subtitle, body).

The search then searches on "text", and returns only matching "id's".

When I set up the 2 fields, and the copyFields, it doesn't seem to work. I'm
guessing for a copyField to work you need to have fields with the same name
already set.

Is there a different way I should be setting it up to achieve the above??

regan
-- 
View this message in context: http://old.nabble.com/do-copyField%27s-need-to-exist-as-Fields--tp26701706p26701706.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: do copyField's need to exist as Fields?

Posted by Jaco Olivier <ja...@sabinet.co.za>.
Hi Regan,

Something I noticed on your setup...
The ID field in your setup I assume to be your uniqueID for the book or
journal (The ISSN or something)
Try making this a string as TEXT is not the ideal field to use for
unique IDs

<field  name="id" type="string" indexed="true" stored="true"
multiValued="false" required="true" />

Congrats on figuring out SOLR fields - I suggest getting the SOLR 1.4
Book.. It really saved me a 1000 questions on this mailing list :)

Jaco Olivier

-----Original Message-----
From: regany [mailto:regan@newzealand.co.nz] 
Sent: 09 December 2009 00:48
To: solr-user@lucene.apache.org
Subject: Re: do copyField's need to exist as Fields?



regany wrote:
> 
> Is there a different way I should be setting it up to achieve the
above??
> 


Think I figured it out.

I set up the <fields> so they are present, but get ignored accept for
the
"text" field which gets indexed...

<field  name="id" type="text" indexed="true" stored="true"
multiValued="false" required="true" />
<field name="title" stored="false" indexed="false" multiValued="true"
type="text" />
<field name="subtitle" stored="false" indexed="false" multiValued="true"
type="text" />
<field name="body" stored="false" indexed="false" multiValued="true"
type="text" />
<field name="text" type="text" indexed="true" stored="false"
multiValued="true" />

and then copyField the first 4 fields to the "text" field:

<copyField source="id" dest="text" />
<copyField source="title" dest="text" />
<copyField source="subtitle" dest="text" />
<copyField source="body" dest="text" />


Seems to be working!? :drunk:
-- 
View this message in context:
http://old.nabble.com/do-copyField%27s-need-to-exist-as-Fields--tp267017
06p26702224.html
Sent from the Solr - User mailing list archive at Nabble.com.

Please consider the environment before printing this email. This 
transmission is for the intended addressee only and is confidential 
information. If you have received this transmission in error, please 
delete it and notify the sender. The content of this e-mail is the 
opinion of the writer only and is not endorsed by Sabinet Online Limited 
unless expressly stated otherwise.

Re: do copyField's need to exist as Fields?

Posted by regany <re...@newzealand.co.nz>.

regany wrote:
> 
> Is there a different way I should be setting it up to achieve the above??
> 


Think I figured it out.

I set up the <fields> so they are present, but get ignored accept for the
"text" field which gets indexed...

<field  name="id" type="text" indexed="true" stored="true"
multiValued="false" required="true" />
<field name="title" stored="false" indexed="false" multiValued="true"
type="text" />
<field name="subtitle" stored="false" indexed="false" multiValued="true"
type="text" />
<field name="body" stored="false" indexed="false" multiValued="true"
type="text" />
<field name="text" type="text" indexed="true" stored="false"
multiValued="true" />

and then copyField the first 4 fields to the "text" field:

<copyField source="id" dest="text" />
<copyField source="title" dest="text" />
<copyField source="subtitle" dest="text" />
<copyField source="body" dest="text" />


Seems to be working!? :drunk:
-- 
View this message in context: http://old.nabble.com/do-copyField%27s-need-to-exist-as-Fields--tp26701706p26702224.html
Sent from the Solr - User mailing list archive at Nabble.com.