Skip to content

replaceDocument adds a new document and leaves the old one #49

@ChrisJokinen

Description

@ChrisJokinen

I was building a wrapper around some of the provided functions and tried to use updateDocument to only find out it had an issue as stated here #10

So I switched to replaceDocument as recommended and after running it I found it only added a second document and kept the old one, not a replace.

My work around was to use the deleteDocument and then follow with a addDocument.

here is my echo/print_r output

SELECT id FROM ww_geo_zips WHERE src_id = 1    
Array    
(    
    [geo_zip_id] => 1    
    [zip] => 34051    
    [city] => FPO    
    [county] => Erie    
    [lat] => 0.716239491787173    
    [lon] => -1.9491645100054953    
    [city_zip_count] => 17    
)    
Array    
(    
    [took] => 11    
    [timed_out] =>     
    [hits] => Array    
        (    
            [total] => 1    
            [hits] => Array    
                (    
                    [0] => Array    
                        (    
                            [_id] => 6053701685393360552    
                            [_score] => 1    
                            [_source] => Array    
                                (    
                                )    
    
                        )    
    
                )    
    
        )    
    
)    
Array    
(    
    [src_id] => 1    
    [zip] => 34051    
    [city] => FPO    
    [county] => Erie    
    [lat] => 0.716239491787173    
    [lon] => -1.9491645100054953    
    [city_zip_count] => 17    
)    
RECNO: 6053701685393360552    
update    
Array    
(    
    [_index] => ww_geo_zips    
    [_id] => 0    
    [created] =>     
    [result] => updated    
    [status] => 200    
)    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions