adding a field?

29 views
Skip to first unread message

tommy c

unread,
Oct 10, 2009, 11:30:21 PM10/10/09
to rsolr
How can I add a field to the index?

Consider this example case, i want to add another field besides the
sample ones.

document = {:id=>"r34re", :publisher=>"TEST"}
>> RSOLR.add document
RSolr::RequestError: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"/>
<title>Error 400 </title>
</head>
<body><h2>HTTP ERROR: 400</h2><pre>ERROR:unknown field 'publisher'</
pre>

Naomi Dushay

unread,
Oct 11, 2009, 10:14:37 AM10/11/09
to rs...@googlegroups.com
Tommy -

Did you add the field to your schema.xml file?  That's in solr/conf

- Naomi

tommy c

unread,
Oct 11, 2009, 2:24:20 PM10/11/09
to rsolr
thanks, this was the line i needed to support dynamic field generation
<dynamicField name="*_i" type="integer" indexed="true"
stored="true"/>

On Oct 11, 7:14 am, Naomi Dushay <naomi.dus...@gmail.com> wrote:
> Tommy -
>
> Did you add the field to your schema.xml file?  That's in solr/conf
>
> - Naomi
>

Naomi Dushay

unread,
Oct 11, 2009, 10:32:05 PM10/11/09
to rs...@googlegroups.com
Tommy -

I hope you've gotten past your problem - I couldn't tell from your message.  The dynamic field you indicate is of type integer, and implies the field name must end in "_i".

publisher_i   could be a field with type integer ...

this is more of a Solr discussion than RSolr, per se ...

- Naomi
Reply all
Reply to author
Forward
0 new messages