index "Inner Objects" in PHP Elasticsearch

I am trying to indexing inner object in Elasticsearch. I am writing it to use this in a running environment where field name "title" should contain another field named "stitle". So "stitle" i can't make it as a field. "stitle" have to be a field inside of "title" field.


foreach ($xml->file as $obj) { $doc = array(); $doc["description"] = (string) $obj->desctiption;


I am writing like so, so when i try to follow the inner object like so

$doc{"title": ["stitle"]} = (string) $obj->short-title;

it gives php error and "nested objects" i guess will not fix my issue since i should name it like "title" and a property of title should be "stitle".

i am using PHP to indexing at Elasticsearch.

Category:php Views:6 Time:2018-12-20

Related post

  • How to get the property name used by outer-object for inner-object from the inner-object in PHP 2011-10-07

    Okay, so code which is outside my control works like this: Class A { function use_b($b_name) { $this -> $b_name = new B(); } } Class B { var $stuff; } So that the object of class B is inside of class A and class A will use a passed in name for the

  • PHP get index of object 2011-02-11

    Possible Duplicate: Get Instance ID of an Object in PHP I'm new to OOP and I have an object. If I: var_dump($obj); I get: object(stdClass)[55] public 'date' => int 1295297161 public 'id' => int 11 How can I retrieve the "55"? --------------Solu

  • Access javascript DOM objects in PHP 2009-06-25

    I have a javascript code helping me to dynamically create row after row in a table and to delete a row from that table. each row has four cells. cell 1 for instance contains a text zone. to differentiate cell1 from row 1 with cell1 from row 2, I rena

  • Get Instance ID of an Object in PHP 2010-05-20

    I've learn a while ago on StackOverflow that we can get the "instance ID" of any resource, for instance: var_dump(intval(curl_init())); // int(2) var_dump(intval(finfo_open())); // int(3) var_dump(intval(curl_init())); // int(4) var_dump(intval(finfo

  • NHibernate Projections, does it support projecting inner objects 2010-09-30

    Does Hibernate + NhibernateLINQ support projection of inner objects. for eg. when I try the following I get an Index out of bounds exception on Patient object on the call to Queryable.ToList() var registrations = from r in _session.Linq<Domain.Reg

  • Freeware Object-Oriented PHP editor 2010-11-18

    Possible Duplicate: Any good PHP IDE, preferably free or cheap? Hello, I'm looking for a good editor to build some object-oriented PHP. Ideally it would have auto-completion (also suggesting my own functions and fields), go-to references within my ow

  • How do I Use Inner Classes in PHP? 2010-12-04

    I'm from a Java background, and I want to use an inner class in php. Every time I put the inner class though, I get a syntax error. Is this possible with PHP? Also, how do I reference the outer class? Do I get access to ALL its data members? <?php

  • Controller Problem when using MVC in Object Orientated PHP 2011-01-05

    I am currently programming a book store using MVC in Object Orientated PHP and I am having a hard time working out how the controller should work when dealing with requests, especially when dealing with forms. For example, I have a search form that i

  • How can I convert an json object into PHP variable and pass it to PHP script? 2012-02-16

    How can I handle my json object resulted from an Ajax call in PHP file instead of js file (I am using jquery)? Let's say I have a phonebook table with name, phonenum columns. My index file have an input text field and when someone types something and

  • indexing Class objects into solr 2012-04-05

    I parsed an xml file and extracted "Title", "ID" and "Text" from the file and stored them as objects. I have a collection of objects containing the info from the xml files. Now i WANT TO index these objects into solr so that I can search the relevant

  • Whats the best book/site/tutorial for learning object oriented php? 2008-09-22

    Im pretty familiar with procedural side of php, but I would like to learn the OO side of things. Can you guys suggest some (short) reads that would get me on my way? Would prefer online articles, to paper. --------------Solutions------------- The fol

  • Debug a DOMDocument Object in PHP 2009-03-26

    I'm trying to debug a large and complex DOMDocument object in php. Ideally it'd be nice if I could get DOMDocument to output in a array-like format. DoMDocument: $dom = new DOMDocument(); $dom->loadHTML("<html><body><p>Hello Worl

  • How to find memory used by an object in PHP? (sizeof) 2009-07-02

    How to find memory used by an object in PHP? (c's sizeof). The object I want to find out about is a dictionary with strings and ints in it so it makes it hard to calculate it manually. Also string in php can be of varied length depending on encoding

  • Cache Object in PHP without using serialize 2009-07-27

    I have a complex object that I create in a PHP script. I am looking for a way to store this object such that subsequent requests do not have to recreate it, or spend time unserializing and rebuilding it. Using xdebug I find that I spend half of the e

  • storing objects in php session 2009-09-18

    The PHP documentation says "You can't use references in session variables as there is no feasible way to restore a reference to another variable." Does this mean I can't have things like: session_start(); $user =new User; $user->name='blah'; $_SES

  • How can I determine if something is an array or an object in PHP? 2009-10-13

    What is the best way to determine if something is an array or an object in PHP? I get a response from a web service and it's either an array or an object depending on how many returned results there are. It is impossible to predict ahead of time how

  • Is object-oriented PHP slow? 2009-10-30

    I used to use procedural-style PHP. Later, I used to create some classes. Later, I learned Zend Framework and started to program in OOP style. Now my programs are based on my own framework (with elements of cms, but without any design in framework),

  • Consuming JSON object in PHP, sent from jQuery 2009-11-19

    I'm sending a JSON object to PHP using jQuery via $.ajax({ url: myURL, type: 'POST', contentType: "application/json; charset=utf-8", data: myData, processData: false, dataType: 'html', async: false, success: function(html) { window.console.log(html);

  • Getting Objective-C Objects in PHP 2009-12-03

    I am sending an NSData Object to the server script running PHP.Is it possible to collect that object in PHP ? Is it possible to get NSArray,NSString, NSData or any Custom Objects (Subclass of NSObject) in PHP ? Thanks --------------Solutions---------

  • Objects in PHP: More or Less is better? 2010-01-04

    I have asked aqbout timezones and date/time before but this is a more specific question, more about Objects in PHP. <?PHP //set the user's time zone on page load date_default_timezone_set("America/Los_Angeles"); //convert the timestamp from DB int

  • How to Copy an Object in PHP? 2010-01-07

    I have a simple 'dimensions' class containing a width/height property and a constructor to set them. I have a function (to re-size dimensions) that takes two dimensions objects -- one to be re-sized, and one containing the max size. It should reduce

  • inner object accessing container 2010-01-20

    Is there a way for an inner object (t1) to access its container object. var t = { fnc1: function(){ alert("fnc1"); }, t1: { fnc2: function(){ alert("fnc2"); }, fnc3: function(){ this.fnc1(); } } }; t.t1.fnc3(); when executing the following code i get

  • Inner workings of PHP 2010-01-29

    I was wondering if there's a decent resource for finding the inner workings of PHP. I have taken a look at the source, but a decent explanation would really help. Some example questions I'd like answered. How does a PHP script get interpreted into ma

  • How to Cast Objects in PHP 2010-02-09

    Ive some clases that share some attributes, and i would like to do something like: $dog = (Dog) $cat; is it posible or is there any generic work around? Its not a superclass, or a interface or related in any way. They are just 2 different clases i wo

  • How can I return an object into PHP userspace from my extension? 2010-05-12

    I have a C++ object, Graph, which contains a property named cat of type Category. I'm exposing the Graph object to PHP in an extension I'm writing in C++. As long as the Graph's methods return primitives like boolean or long, I can use the Zend RETUR

Copyright (C), All Rights Reserved.

processed in 0.393 (s). 11 q(s)