org.apache.solr.common.SolrException: ERROR: [doc=SOMEURL] unknown field '' - solr

Hi I am getting this exception and I've exhausted all the possible settings that I could think of.
org.apache.solr.common.SolrException: ERROR: [doc=SOMEURL] unknown field ''
The problem is field '' - the quotation marks are empty so I don't know what causes the problem.
Does anybody had the same problem? I will help me a lot.
Some informations:
Nutch version 2.1
Solr version 1.5
Hbase as a data storage
-Tomcat6 for Solr running
In code have just this:
nutchDocument.add("my_key",stringValue);
I have checked Solr's schema.xml, Nutch's schema.xml and also Nutch solr-mapping.xml (I am sure in the right directories) in each is "my_key" written in the right way.
Thanks for help

Well, I had to be blind. I found where was the problem. For someone who will have the similar problem here is the reason:
In my solrindex-mapping.xml I had this:
<field dest="video_og_title" source="video_og_title" />
<field dest="video_og_type" source="video_og_type"/>
<field dest="video_og_image" source="video_og_image" />
<field name="video_og_url" source="video_og_url"/>
<field name="video_og_description" source="video_og_description" />
<field name="video_og_video" source="video_og_video" />
I didn't see the field has attribute name and not dest so Solr represent the dest attribute, which it uses for mapping like empty field ' '.

Related

How to add new type to Solr?

What is the proper way to add my custom field type, written on Java, extended from Solr's FieldType class?
I've tried to add jar with my type to sole/lib folder, but while creating collection I'm getting
HttpSolrClient$RemoteSolrException:Error from server at http://node:8983/solr: Error CREATEing SolrCore 'custom_type_shard1_replica_n1': Unable to create core [custom_type_shard1_replica_n1] Caused by: com.custom.type.Location"
In FieldType's write() method I just log incoming field for testing purpose.
This is how I define my type an use it in managed_schema file:
<fieldType name="customlocation" class="com.custom.type.Location"/>
...
<field name="location" type="customlocation" indexed="true" stored="false"/>
I've found a couple vvery short tutorials, for example this and this
But is there any official and full tutorial about creating and defining custom field type for Solr?

400 Bad Request: unknown field 'type'

I've set up Solr 3.6.2 on Tomcat as described here.
Using the sunspot-rails gem and the embedded solr server I have no problems, but on my staging server I'm getting the response:
message ERROR: [doc=Foo 20] unknown field 'type'
description The request sent by the client was syntactically incorrect.
The request data looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<add>
<doc>
<field name="id">Foo 20</field>
<field name="type">Foo</field>
<field name="type">ActiveRecord::Base</field>
<field name="class_name">Foo</field>
<field name="name">test</field>
</doc>
</add>
What's causing this? Is there some configuration that should be set? (I'm expecting something that allows for the type name to be used regardless of whether or not such a column exists.)
It turns out that the sunspot-solr gem expects a slightly different schema.xml than the default that is bundled with solr.
I replaced the file with the one that the gem uses (from here) and it works fine now. This answer explains what the schema.xml file is.

tika solr integration

I am trying to index using curl based request
the request is
curl "http://localhost:8080/solr1/update/extract?literal.id=who.pdf&uprefix=attr_&fmap.content=attr_content&commit=true" -F "myfile=#/root/apache-solr-3.1.0/docs/who.pdf"
On submitting the request, i am getting this error,
Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - ERROR:unknown field 'ignored_meta'</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>ERROR:unknown field 'ignored_meta'</u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect (ERROR:unknown field 'ignored_meta').</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.18</h3></body></html>r
Your problem is due to the fact that the default handler for ExtractingRequestHandler defined in the solrconfig.xml put all the Tika's not identified extracted fields into fields named 'ingored_XXXXX'.
To solve this, you can simply add to your Solr configuration a field name 'ignored_*' like this:
<dynamicField name="ignored_*" type="ignored"/>
Don't forget to add also the ignored type if you remove it from the default configuration:
<fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
This will stop your Solr from crashing when Tika index fields that Solr don't know of.

make location fields made visible in solr

I have the following field defined in solr (schema.xml)
<field name="store" type="location" indexed="true" stored="true"/>
If I search for say this-
&fq={!geofilt pt=45.15,-93.85 sfield=store d=5}
Then I can see the location coordinates in the search result.
But the field "store" seems to be a hidden field under normal circumstances. How do I get the coordinates to be a part of the search result for normal searches? (q=*:* for example)
I just verified that this works correctly for both Solr 3.1 and Solr 4.0-dev with the example data.
Example:
http://localhost:8983/solr/select?q=:&fl=id,store&wt=json&indent=true
[...]
"response":{"numFound":17,"start":0,"docs":[
{
"id":"SP2514N",
"store":"35.0752,-97.032"},
{
"id":"6H500F0",
"store":"45.17614,-93.87341"},
{
"id":"F8V7067-APL-KIT",
"store":"45.18014,-93.87741"},
[...]
Did you perhaps change this setting and forget to re-index or forget to commit?

Example solr xml working fine but my own xml files not working

Please find below necessary steps that executed.
Iam following same structure as mentioned by you, and checked results in the admin page by clicking search button, samples are working fine.
Ex:Added monitor.xml and search for video its displaying results----- search content is displaying properly
Let me explain you the problem which iam facing:
step 1: I started Apache tomcat
step2 : Indexing Data
java -jar post.jar myfile.xml
Here is my XML content:
<add>
<doc>
<field name="id">11111</field>
<field name="name">Youth to Elder</field>
<field name="Author"> Integrated Research Program</field>
<field name="Year">2009</field>
<field name="Publisher"> First Nation</field>
</doc>
<doc>
<field name="id">22222</field>
<field name="name">Strategies </field>
<field name="Author">Implementation Committee </field>
<field name="Year">2001</field>
<field name="Publisher">Policy</field>
</doc>
</add>
Step 4 : i did
java -jar post.jar myfile.xml
output of above one:
SimplePostTool: version 1.2
SimplePostTool: WARNING: Make sure your XML documents are encoded in UTF-8, othe
r encodings are not currently supported
SimplePostTool: POSTing files to http://localhost:8983/solr/update..
SimplePostTool: POSTing file curnew.xml
SimplePostTool: FATAL: Solr returned an error: Bad Request
Request to help me on this.
You need to configure your schema. The default schema doesn't have any Author, Year or Publisher fields.

Resources