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 8000479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:48:28+00:00 2026-06-04T15:48:28+00:00

I am using the elastica php client for ElasticSearch. I’m a bit new to

  • 0

I am using the “elastica” php client for ElasticSearch.

I’m a bit new to OO-programming, especially in php.

However, I have managed to search my elasticsearch server using the elastica php client and store the response in an “Elastica_ResultSet” object. I have had no luck accessing the contents of that object whatsoever.

I would like to be able to list the total number of results, find an elasticsearch record id of a result and get the full content of an elasticsearch record for that result.

The Elastica class reference can be found here http://ruflin.github.com/Elastica/api/index.html , although I don’t know what to do with it.

Here is the php code I have been using to get this far:

<?php
function __autoload_elastica ($class) {
    $path = str_replace('_', '/', $class);

    if (file_exists('extentions/' . $path . '.php')) {
        require_once('extentions/' . $path . '.php');
        //echo "$path EXISTS!!!";
    }
}
spl_autoload_register('__autoload_elastica');

// New ES Client
$client = new Elastica_Client();

// Set Index
$index = $client->getIndex('test1');

// Set Document Type
$type = $index->getType('user');

// Perform Search
$resultSet = $index->search('halo');
?>
  • 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-04T15:48:30+00:00Added an answer on June 4, 2026 at 3:48 pm

    After a couple of months OO practise, it seemed performing a simple var_dump($resultSet) would have provided me with the structure and contents of the returned object… can’t believe that nobody made any suggestions for such a basic question 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using cakephp 1.3 and fancybox..I have managed to put a form in
Using EC2 instances (along with Amazon Auto Scaling and Elastic Load Balancing) I have
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
Using PHP, I can convert MySQL data or static table data to csv, Excel,
Using C# for ASP.NET and MOSS development, we often have to embed JavaScript into
I am using SearchBuilder.searchSource.query(query_string).buildAsBytes() to perform the query string on elasticsearch servers. The problem
I am using colorbox to AJAX some external HTML onto a page. My client
We are trying to develop a strategy for using elasticsearch for full-text searching on
(this is in a Java project) I'm using a search engine in parallel with
A little bit about my current situation: I have a decent knowledge of OOP

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.