• Resolved localx

    (@localx)


    I have a few custom fields articledescription, articlefullurl etc in post. Everything works as expected. However, when I query the index using Solr API. The custom fields are returned as part of Categories. See response below.

    How to remove the custom fields from categories in resultset?

    <arr name=”categories”>
    <str>
    Finding the best Mexican restaurant in San Diego is easy. Learn where to get the Mexican best food, drinks in the city.
    </str>
    <str>
    /images/1/Large/San_Diego_s_Best_Mexican_Restaurant_191_242287005.jpg
    </str>
    <str>
    /images/1/Medium/San_Diego_s_Best_Mexican_Restaurant_191_242287005.jpg
    </str>
    <str>
    /images/1/Small/San_Diego_s_Best_Mexican_Restaurant_191_242287005.jpg
    </str>
    <str>
    /1/Thumbs/San_Diego_s_Best_Mexican_Restaurant_191_242287005.jpg
    </str>
    </arr>
    <arr name=”articledescription_str”>…</arr>
    <arr name=”articlefullurl_str”>…</arr>
    <arr name=”articlemediumurl_str”>…</arr>
    <arr name=”articlesmallurl_str”>…</arr>
    <arr name=”articlethumbnailurl_str”>…</arr>

    https://www.ads-software.com/plugins/wpsolr-search-engine/

Viewing 1 replies (of 1 total)
  • Thread Starter localx

    (@localx)

    Figured this out.

    Need to change the following line in wpsolr-schema.php
    //const _FIELD_NAME_CUSTOM_FIELDS = ‘categories’;
    const _FIELD_NAME_CUSTOM_FIELDS = ‘custom_fields’;

    Then define a custom_fields in schema.xml.
    <field name=”custom_fields” type=”string” indexed=”true” stored=”true” multiValued=”true”/>

    It would be good that some one can check in the fix. Hopefully this helps someone with the same issue.

Viewing 1 replies (of 1 total)
  • The topic ‘Categories mixed with custom fields’ is closed to new replies.