Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8659911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:07:19+00:00 2026-06-12T16:07:19+00:00

I am trying to index a table from MySQL with Solarium and PHP. In

  • 0

I am trying to index a table from MySQL with Solarium and PHP. In order to test, I have a list of countries and have set up a core in Solr to reflect the fields I am retrieving in the query. I am getting an error when trying to add these using Solarium:

Fatal error: Uncaught exception 'Solarium_Client_HttpException' with message 'Solr HTTP error: ERROR: [doc=1] unknown field 'code' (400)' in solariumQuickStart\Library\Solarium\Result.php on line 98
( ! ) Solarium_Client_HttpException: Solr HTTP error: ERROR: [doc=1] unknown field 'code' (400) in solariumQuickStart\Library\Solarium\Result.php on line 98

and here is my code:

foreach($worldDBRecords as $record)
{

    // create a new document for the data
    $doc = $update->createDocument();
    $doc->code = $record[0];
    $doc->name = $record[1];
    $doc->continent = $record[2];
    $doc->region = $record[3];
    $doc->population = $record[4];
    $update->addDocument($doc);
}

$update->addCommit();
$result = $client->update($update);

My connection to Solr is working and I have defined the core in my Solarium_Client configuration. I also have the code field defined in my schema file, but it is not being recognized. Any help is appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:07:21+00:00Added an answer on June 12, 2026 at 4:07 pm

    I re-setup my Solr core to make sure my configuration was correct. Also, I was missing the ‘adapteroptions’ setting in my Solarium config, it worked after this:

    $config = array(
    'adapteroptions' => array(
    'host' => 'localhost',
    'port' => 8983,
    'path' => '/solr/',
    'core' => 'world'
    )
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to remove duplicates from a MySQL table using ALTER IGNORE TABLE +
I'm trying to index a text field in mysql innodb-table and seems like hash
Using MySQL and PHP; I'm trying to build an index that contains the averages
I am trying to get several records by composite index from a table having
I'm trying to index data from a database in Solr using the DIH. So
Ok I have a temporary MySQL table with 135,000 rows, from this temporary table
I'm trying to call a row update from php to an mysql database. It
I'm trying to remove doublettes (sometimes triplettes, unfortunately!) from a MySQL table. My issue
I am trying to index a table for full text search in a SQL
I'm trying to load a table, create an index, collect statistics, grant select permissions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.