Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"400" Status: ERRORunknown_field_sf_unique_id #9

Open
elmoby opened this issue Sep 26, 2010 · 3 comments
Open

"400" Status: ERRORunknown_field_sf_unique_id #9

elmoby opened this issue Sep 26, 2010 · 3 comments

Comments

@elmoby
Copy link

elmoby commented Sep 26, 2010

Hello. I'm getting this error when creating a new record into a Solr behaviour table.
I've debugged the application up to it gets to $invoker->addToIndex();

This function makes a call to the __call($method, $arguments) method of sfDoctrineRecord.class.php where tries to evaluate the $method parameter whether is a "get" or a "set".
But the problem is that the $method parameter is a "addToIndex" so it throws an execption and the record is not inserted.

Here is my schema config and the error trace:

ForumThread:
actAs:
Solr:
fields: [ subject, content ]
fieldmap: { subject: subject_t, content: content_t }
Sluggable:
fields: [subject]
Timestampable: ~
options:
collate: utf8_unicode_ci
charset: utf8
columns:
forum_id: { type: integer(11), notnull: true }
user_id: { type: integer(4), notnull: true }
subject: { type: string(400), notnull: true }
content: { type: clob, notnull: true }
posts: { type: integer(6), default: 0 }
views: { type: integer(6), default: 0 }
new_post: { type: boolean, notnull: true, default: 0 }
relations:
User: { class: sfGuardUser, local: user_id, foreign: id, type: one }

Forum: { class: Forum, local: forum_id, foreign: id, type: one }

at ()
in SF_ROOT_DIR/plugins/tjSolrDoctrineBehaviorPlugin/lib/vendor/solrphpclient/Service.php line 385 ...

   382.


   383.         if ($response->getHttpStatus() != 200)
   384.         {
   385.             throw new Exception('"' . $response->getHttpStatus() . '" Status: ' . $response->getHttpStatusMessage(), $response->getHttpStatus());
   386.         }
   387.

   388.         return $response;


*



   382. at Apache_Solr_Service->_sendRawPost('http://localhost:8983/solr/update?wt=json', '<add allowDups="false" overwritePending="true" overwriteCommitted="true"><doc><field name="sf_unique_id">ForumThread_1</field><field name="sf_meta_class">ForumThread</field><field name="sf_meta_id">1</field><field name="subject" boost="1">aaaa</field><field name="content" boost="1">bbbbb</field></doc></add>')
        in SF_ROOT_DIR/plugins/tjSolrDoctrineBehaviorPlugin/lib/vendor/solrphpclient/Service.php line 652 ...
               649.      */
               650.     public function add($rawPost)
               651.     {
               652.         return $this->_sendRawPost($this->_updateUrl, $rawPost);
               653.     }
               654.
               655.     /**
   383. at Apache_Solr_Service->add('<add allowDups="false" overwritePending="true" overwriteCommitted="true"><doc><field name="sf_unique_id">ForumThread_1</field><field name="sf_meta_class">ForumThread</field><field name="sf_meta_id">1</field><field name="subject" boost="1">aaaa</field><field name="content" boost="1">bbbbb</field></doc></add>')
        in SF_ROOT_DIR/plugins/tjSolrDoctrineBehaviorPlugin/lib/vendor/solrphpclient/Service.php line 676 ...
               673.         $rawPost .= $this->_documentToXmlFragment($document);
               674.         $rawPost .= '</add>';
               675.
               676.         return $this->add($rawPost);
               677.     }
               678.
               679.     /**
   384. at Apache_Solr_Service->addDocument(object('Apache_Solr_Document'))
        in SF_ROOT_DIR/plugins/tjSolrDoctrineBehaviorPlugin/lib/Search/Handler/Solr.php line 60 ...
                57.   public function index(array $document)
                58.   {
                59.     $doc = $this->buildDocument($document);
                60.     $this->_service->addDocument($doc);
                61.   }
                62.
                63.   /**
   385. at Search_Handler_Solr->index(array('sf_unique_id' => array('value' => 'ForumThread_1'), 'sf_meta_class' => array('value' => 'ForumThread'), 'sf_meta_id' => array('value' => '1'), 'subject' => array('value' => 'aaaa', 'boost' => 1), 'content' => array('value' => 'bbbbb', 'boost' => 1)))
@pulse00
Copy link
Contributor

pulse00 commented Oct 25, 2010

i'm getting a similar error, but here the exception talks about an unknown property "fields_array". did you solve the problem somehow?

@eljam
Copy link

eljam commented Nov 17, 2010

do not use the getFieldsArray(), doctrine wants to find a field called "fiels_array", rename it with retreiveFieldsArray, this should work. Never use a get on a record because the _call function use it to retreive data for each column.

@pulse00
Copy link
Contributor

pulse00 commented Nov 19, 2010

the plugin uses the getFieldsArray() internally, so one would need to refactor the plugin. the strange thing is, that it works on all of our models, except one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants