indexing array from meta field

  • dnikola
    Participant
    3 years, 11 months ago #19824

    Hi Patrice,

    on post index we use option to add meta filed with value as array.

    this is example of array
    5:{s:3:”sID”;s:7:”8605074″;s:7:”sDataID”;s:7:”1277409″;s:4:”user”;s:2:”17″;s:5:”user2″;s:1:”0″;s:4:”uniq”;s:1:”0″;}

    It is indexed as separated field in Elasticsearch but also it is added at the end of content in Elasticsearch with all custom taxonomy’s.

    what and where to debug, what do you think?

    Thasnk!

    dnikola
    Participant
    3 years, 11 months ago #19825

    I just made simple test I have deleted this post meta with arrays and reindexed this post, and still a the end of content i get Content + all taxonomy’s after content together, and this is for custom post type not sure about post i can test if you think that it will make some difference..

    wpsolr
    Keymaster
    3 years, 11 months ago #19827

    You should probably not index this field if it only contains ids.

    dnikola
    Participant
    3 years, 11 months ago #19837

    Hi,

    actually it is problem with custom taxonomy’s also

    take a look on this photo, and you will see that all custom taxonomy’s for custom post are indexed with this two fields at the end of content
    https://prntscr.com/se1x8b

    To make clear for your:
    Nekategorisano. bbc.com. News. Web portal. Vijest. are taxonomys

    and than this two arrays
    a:5:{s:8:”pdf_urls”;s:0:””;s:13:”crop_pdf_urls”;s:0:””;s:7:”segment”;s:20:”8622733:1588595968:0″;s:8:”importID”;s:7:”3697452″;s:6:”srcURL”;s:55:”https://www.bbc.co.uk/news/world-latin-america-52528881″;}.

    a:5:{s:3:”sID”;s:7:”8622733″;s:7:”sDataID”;s:7:”1278372″;s:4:”user”;s:2:”17″;s:5:”user2″;s:1:”0″;s:4:”uniq”;s:1:”0″;}

    are poste meta field

    Also they are repeated indexed as they should
    https://prntscr.com/se1xvw
    https://prntscr.com/se1y13

    and for category (I don’t have it for this custom post i have another taxonomy’s) they are all indexed in field category + this two meta fields
    https://prntscr.com/se21m2

    wpsolr
    Keymaster
    3 years, 11 months ago #19840

    What you want in fact is to deserialize custom fields before indexing.

    It is done in our next release (and is already done for ACF fields).

    dnikola
    Participant
    3 years, 11 months ago #19841

    Based on your response I figured out that I need to wait for another release for problem with this two custom post meta fields which are serialized?
    You make update for ACF fields which are also serialized, and will work with any another field?
    You think that problem because they appear at the end of content is because they are serialized fields?

    and what about this with appearing custom taxonomy’s also at the end of content?

    wpsolr
    Keymaster
    3 years, 11 months ago #19842

    Fields appear at the end of content because of option “Insert custom fields and taxonomies in content” in screen 2.2. Serialized or not.

    The fix will work with all custom fields, yes.

    dnikola
    Participant
    3 years, 11 months ago #19843

    Could you please point me to that function?!

    Cannot find it :/

    wpsolr
    Keymaster
    3 years, 11 months ago #19845

    Third checkbox “Index custom fields and categories” in screen “2.2 Data”.

    dnikola
    Participant
    3 years, 11 months ago #19847

    Damn, I am blind! 🙂

    Thanks!

    dnikola
    Participant
    3 years, 11 months ago #19872

    Hi Patrice,

    as you wrote in your replay here

    “What you want in fact is to deserialize custom fields before indexing.
    It is done in our next release (and is already done for ACF fields).”

    When you will have that release? Can I get pre-release to test?

    Thanks!

    wpsolr
    Keymaster
    dnikola
    Participant
    3 years, 11 months ago #19891

    Thanks!

    any specific option I should use or it will do that by default?

    Regards!

    wpsolr
    Keymaster
    3 years, 11 months ago #19892

    Nothing to do. It will automatically unserialize serialized metas before indexing a post type.

    dnikola
    Participant
    3 years, 11 months ago #19893

    Ok, I see that, I jest let 100 000+ post to idnex and i see that this fields are unserialized .

    I tough that they will be unserialized and created as some array inside that post meta key?

    what are benefits having this kind of data when previous and this way are both searchable ?

    Even keys are lost and i don’t know how to fetch data, before I could get that filed data and than get value from array, now when i don’t know key i cannot do that :/

    Could you please put option to check if we want to get this post meta unserialized , If this is how it will work, it will mess up things for me so I would like to turn it off :/

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.