WordPress.org

Ready to get started?Download WordPress

Forums

Fantastic ElasticSearch
[resolved] How to do a meta float facet? (6 posts)

  1. Marko Heijnen
    Member
    Posted 1 year ago #

    Currently I have a simple widget working for taxonomies but for price I use a meta value.

    On https://gist.github.com/markoheijnen/6129265 you find my current code example. It does index the value and retrieves it correctly but it doesn't recognize it as a range. The option field 'meta_price Range' I still have empty since I don't have really requirements for it.

    http://wordpress.org/plugins/fantastic-elasticsearch/

  2. Paris Holley
    Member
    Plugin Author

    Posted 1 year ago #

    think your approach is the right way to do it, i don't think there is an intuitive way to allow people to select meta from admin given how random it can be.

    In addition to what you have, you may also have to filter "elasticsearch_config_ranges", as well as "elasticsearch_config_option" for "numeric".

  3. Marko Heijnen
    Member
    Posted 1 year ago #

    I agree on the first. I think the two last filters are not really needed since filtering fields does allow it. But will just do it any way to be sure and see if it then stop breaking

  4. Marko Heijnen
    Member
    Posted 1 year ago #

    Currently having this when saving Field Mapping option page. Will look into it why I get this. I did wipe all data first.

    [01-Aug-2013 20:05:06 UTC] exception 'Elastica\Exception\ResponseException' with message 'MergeMappingException[Merge failed with failures {[mapper [meta_price] has different store values]}]' in /public_html/wp-content/plugins/fantastic-elasticsearch/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php:137
    Stack trace:
    #0 /public_html/wp-content/plugins/fantastic-elasticsearch/vendor/ruflin/elastica/lib/Elastica/Request.php(166): Elastica\Transport\Http->exec(Object(Elastica\Request), Array)
    #1 /public_html/wp-content/plugins/fantastic-elasticsearch/vendor/ruflin/elastica/lib/Elastica/Client.php(536): Elastica\Request->send()
    #2 /public_html/wp-content/plugins/fantastic-elasticsearch/vendor/ruflin/elastica/lib/Elastica/Index.php(405): Elastica\Client->request('aweb/post/_mapp...', 'PUT', Array, Array)
    #3 /public_html/wp-content/plugins/fantastic-elasticsearch/vendor/ruflin/elastica/lib/Elastica/Type.php(453): Elastica\Index->request('post/_mapping', 'PUT', Array, Array)
    #4 /public_html/wp-content/plugins/fantastic-elasticsearch/vendor/ruflin/elastica/lib/Elastica/Type/Mapping.php(233): Elastica\Type->request('_mapping', 'PUT', Array)
    #5 /public_html/wp-content/plugins/fantastic-elasticsearch/wp/admin/sections/field-mapping.php(65): Elastica\Type\Mapping->send()
    #6 [internal function]: elasticsearch\{closure}(Array)
    #7 /public_html/wp-includes/plugin.php(406): call_user_func_array(Object(Closure), Array)
    #8 /public_html/wp-content/plugins/fantastic-elasticsearch/wp/lib/nhp/options/options.php(531): do_action('nhp-opts-option...', Array, Array)
    #9 [internal function]: NHP_Options->_validate_options(Array)
    #10 /public_html/wp-includes/plugin.php(173): call_user_func_array(Array, Array)
    #11 /public_html/wp-includes/formatting.php(2914): apply_filters('sanitize_option...', Array, 'elasticsearch')
    #12 /public_html/wp-includes/option.php(227): sanitize_option('elasticsearch', Array)
    #13 /public_html/wp-admin/options.php(155): update_option('elasticsearch', Array)
    #14 {main}
    [01-Aug-2013 20:05:07 UTC] PHP Notice: Undefined index: section_id in /public_html/wp-content/plugins/fantastic-elasticsearch/wp/lib/nhp/options/options.php on line 837
    [01-Aug-2013 20:05:07 UTC] PHP Notice: Undefined index: section_id in /public_html/wp-content/plugins/fantastic-elasticsearch/wp/lib/nhp/options/options.php on line 837
    [01-Aug-2013 20:05:07 UTC] PHP Notice: Undefined index: section_id in /public_html/wp-content/plugins/fantastic-elasticsearch/wp/lib/nhp/options/options.php on line 838

  5. Paris Holley
    Member
    Plugin Author

    Posted 1 year ago #

    I think that bit of code in the field mapping is old and probably shouldn't be there. I've created a issue here to look into it further

    https://github.com/parisholley/wordpress-fantastic-elasticsearch/issues/35

  6. Paris Holley
    Member
    Plugin Author

    Posted 1 year ago #

    mapping code was removed from admin, open a github issue if you have problems

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.